public abstract class W3CPipeline<W,C extends W,M extends C> extends BasePipeline<W,C,Element,M>
org.w3c.dom
.Constructor and Description |
---|
W3CPipeline() |
Modifier and Type | Method and Description |
---|---|
protected void |
configure() |
protected void |
configureDefaults()
Configure a default Inspector (
setInspector ),
list of InspectionResultProcessors (setInspectionResultProcessors ),
WidgetBuilder (setWidgetBuilder ), list of
WidgetProcessors (setWidgetProcessors ) and a Layout (setLayout ). |
protected String |
elementToString(Element element)
Serialize the given element to an XML String.
|
protected Map<String,String> |
getAttributesAsMap(Element element) |
Object |
getConfig()
Reference to the configuration file.
|
ConfigReader |
getConfigReader()
Gets the current
ConfigReader , or creates a default one if one hasn't been set. |
protected abstract String |
getDefaultConfiguration() |
protected String |
getElementName(Element element) |
protected Element |
getFirstChildElement(Element parent) |
<T> T |
getInspectionResultProcessor(Class<T> inspectionResultProcessorClass)
Returns the first InspectionResultProcessor in this pipeline's list of
InspectionResultProcessors (ie.
|
protected Element |
getNextSiblingElement(Element element) |
<T> T |
getWidgetProcessor(Class<T> widgetProcessorClass)
Returns the first WidgetProcessor in this pipeline's list of WidgetProcessors (ie.
|
void |
initNestedPipeline(BasePipeline<W,C,Element,M> nestedPipeline,
Map<String,String> attributes)
Overridden to support custom ConfigReaders.
|
void |
setConfig(Object config) |
void |
setConfigReader(ConfigReader configReader) |
protected Element |
stringToElement(String xml) |
addInspectionResultProcessor, addWidgetProcessor, buildCompoundWidget, buildNestedMetawidget, buildWidget, buildWidgets, configureOnce, endBuild, getAdditionalAttributes, getInspectionResultProcessors, getInspector, getLayout, getMaximumInspectionDepth, getPipelineOwner, getWidgetBuilder, getWidgetProcessors, inspect, inspectAsDom, isReadOnly, layoutWidget, processInspectionResult, processWidget, removeInspectionResultProcessor, removeWidgetProcessor, setInspectionResultProcessors, setInspector, setLayout, setMaximumInspectionDepth, setNeedsConfiguring, setReadOnly, setWidgetBuilder, setWidgetProcessors, startBuild
public final ConfigReader getConfigReader()
ConfigReader
, or creates a default one if one hasn't been set.
Subclasses wishing to set a different default should call setConfigReader
. Care
should be taken to reuse the same ConfigReader
instance as much as
possible, to maximize caching.
public void setConfigReader(ConfigReader configReader)
public Object getConfig()
com/myapp/metawidget.xml
), but can also be an id (e.g. for Android).public void setConfig(Object config)
public <T> T getInspectionResultProcessor(Class<T> inspectionResultProcessorClass)
addInspectionResultProcessor
) that
the given class isAssignableFrom
.
This method is here, rather than in BasePipeline
, because even though
GwtPipeline
overrides it the GWT compiler still chokes on the
isAssignableFrom
.
T
- the type of the InspectionResultProcessor. Note this needn't be a subclass of
InspectionResultProcessor
inspectionResultProcessorClass
- the class, or interface or superclass, to find. Returns null
if no
such InspectionResultProcessorpublic <T> T getWidgetProcessor(Class<T> widgetProcessorClass)
addWidgetProcessor
) that the given class isAssignableFrom
.
This method is here, rather than in BasePipeline
, because even though
GwtPipeline
overrides it the GWT compiler still chokes on the
isAssignableFrom
.
T
- the type of the WidgetProcessor. Note this needn't be a subclass of
WidgetProcessor
. It may be some orthagonal interface (like
org.metawidget.faces.component.widgetprocessor.ConverterProcessor
)widgetProcessorClass
- the class, or interface or superclass, to find. Returns null
if no
such WidgetProcessorpublic void initNestedPipeline(BasePipeline<W,C,Element,M> nestedPipeline, Map<String,String> attributes)
initNestedPipeline
in class BasePipeline<W,C extends W,Element,M extends C>
attributes
- may be nullprotected void configure()
protected abstract String getDefaultConfiguration()
protected void configureDefaults()
setInspector
),
list of InspectionResultProcessors (setInspectionResultProcessors
),
WidgetBuilder (setWidgetBuilder
), list of
WidgetProcessors (setWidgetProcessors
) and a Layout (setLayout
).protected Element stringToElement(String xml)
stringToElement
in class BasePipeline<W,C extends W,Element,M extends C>
protected String elementToString(Element element)
BasePipeline
elementToString
in class BasePipeline<W,C extends W,Element,M extends C>
element
- the element to serialize. May be null.protected Element getFirstChildElement(Element parent)
getFirstChildElement
in class BasePipeline<W,C extends W,Element,M extends C>
protected Element getNextSiblingElement(Element element)
getNextSiblingElement
in class BasePipeline<W,C extends W,Element,M extends C>
protected String getElementName(Element element)
getElementName
in class BasePipeline<W,C extends W,Element,M extends C>
Copyright © 2015. All Rights Reserved.