public abstract class BaseInspectionResultProcessor<M> extends Object implements DomInspectionResultProcessor<Element,M>
Constructor and Description |
---|
BaseInspectionResultProcessor() |
Modifier and Type | Method and Description |
---|---|
protected void |
processAttributes(Map<String,String> attributes,
M metawidget)
Process the given attributes (which may belong to either entity, property or action).
|
protected void |
processEntity(Map<String,String> attributes,
M metawidget,
Object toInspect,
String type,
String... names)
Defers to
processAttributes by default. |
String |
processInspectionResult(String inspectionResult,
M metawidget,
Object toInspect,
String type,
String... names)
Process the given inspection result in context of the given Metawidget.
|
Element |
processInspectionResultAsDom(Element inspectionResult,
M metawidget,
Object toInspect,
String type,
String... names)
Optimized verison of
processInspectionResult that avoids DOM
serialization/deserialization. |
protected void |
processTrait(Map<String,String> attributes,
M metawidget)
Defers to
processAttributes by default. |
protected void |
processTraits(Element entity,
M metawidget,
Object toInspect,
String type,
String... names)
Process the traits of the given entity.
|
public final String processInspectionResult(String inspectionResult, M metawidget, Object toInspect, String type, String... names)
This method is marked final
because most Metawidget implementations will call
processInspectionResultAsDom
directly instead. So subclasses need to override
processInspectionResultAsDom
, not processInspectionResult
.
processInspectionResult
in interface InspectionResultProcessor<M>
inspectionResult
- the inspection result to process, as XML conforming to inspection-result-1.0.xsd.
Never nullmetawidget
- the parent Metawidget. Never null. May be useful to help processingtoInspect
- the Object being inspected. May be useful to help processingtype
- the type being inspected. May be useful to help processingnames
- the names being inspected. May be useful to help processingpublic Element processInspectionResultAsDom(Element inspectionResult, M metawidget, Object toInspect, String type, String... names)
DomInspectionResultProcessor
processInspectionResult
that avoids DOM
serialization/deserialization.processInspectionResultAsDom
in interface DomInspectionResultProcessor<Element,M>
inspectionResult
- the inspection result to process. Never nullprotected void processTraits(Element entity, M metawidget, Object toInspect, String type, String... names)
entity
- the DOM Element representing the entity that contains the traitsmetawidget
- the parent Metawidget. Never null. May be useful to help processingtoInspect
- the Object being inspected. May be useful to help processingtype
- the type being inspected. May be useful to help processingnames
- the names being inspected. May be useful to help processingprotected void processEntity(Map<String,String> attributes, M metawidget, Object toInspect, String type, String... names)
processAttributes
by default.attributes
- attributes of the entity being processed. Subclasses can modify this Map to
modify the attributesmetawidget
- the parent Metawidget. Never null. May be useful to help processingtoInspect
- the Object being inspected. May be useful to help processingtype
- the type being inspected. May be useful to help processingnames
- the names being inspected. May be useful to help processingprotected void processTrait(Map<String,String> attributes, M metawidget)
processAttributes
by default.attributes
- attributes of the trait being processed. Subclasses can modify this Map to
modify the attributesmetawidget
- the parent Metawidget. Never null. May be useful to help processingtoInspect
- the Object being inspected. May be useful to help processingtype
- the type being inspected. May be useful to help processingnames
- the names being inspected. May be useful to help processingprotected void processAttributes(Map<String,String> attributes, M metawidget)
Does nothing by default.
attributes
- attributes of the trait being processed. Subclasses can modify this Map to
modify the attributesmetawidget
- the parent Metawidget. Never null. May be useful to help processingCopyright © 2015. All Rights Reserved.