Class ModelLessXMLValuesExtractor
java.lang.Object
org.ametys.plugins.repository.data.extractor.xml.ModelLessXMLValuesExtractor
- All Implemented Interfaces:
ModelLessValuesExtractor
,ValuesExtractor
This class provides methods to extract values from an XML document
-
Field Summary
Modifier and TypeFieldDescriptionprotected XMLValuesExtractorAdditionalDataGetter
The getter that retrieves needed additional data by typesprotected AbstractThreadSafeComponentExtensionPoint<? extends ModelItemType>
Extension point providing available data typesprotected Element
The DOM element containing the XML values -
Constructor Summary
ConstructorDescriptionModelLessXMLValuesExtractor
(Element element, XMLValuesExtractorAdditionalDataGetter additionalDataGetter, AbstractThreadSafeComponentExtensionPoint<? extends ModelItemType> dataTypesExtensionPoint) Creates a model less XML values extractor -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> T
_extractValue
(Element currentElement, String relativeDataPath, String prefix) Extracts the value at the given path_extractValues
(Element currentElement, String prefix) Extracts all the values in the current element<T> T
extractValue
(String dataPath) Extracts the value at the given pathExtracts all the values
-
Field Details
-
_element
The DOM element containing the XML values -
_additionalDataGetter
The getter that retrieves needed additional data by types -
_dataTypesExtensionPoint
protected AbstractThreadSafeComponentExtensionPoint<? extends ModelItemType> _dataTypesExtensionPointExtension point providing available data types
-
-
Constructor Details
-
ModelLessXMLValuesExtractor
public ModelLessXMLValuesExtractor(Element element, XMLValuesExtractorAdditionalDataGetter additionalDataGetter, AbstractThreadSafeComponentExtensionPoint<? extends ModelItemType> dataTypesExtensionPoint) Creates a model less XML values extractor- Parameters:
element
- the DOM element containing the XML valuesadditionalDataGetter
- the getter that retrieves needed additional data by typesdataTypesExtensionPoint
- the extension point providing available data types
-
-
Method Details
-
extractValues
Description copied from interface:ModelLessValuesExtractor
Extracts all the values- Specified by:
extractValues
in interfaceModelLessValuesExtractor
- Returns:
- the values
- Throws:
Exception
- if an error occurs
-
_extractValues
Extracts all the values in the current element- Parameters:
currentElement
- the current elementprefix
- the path of the item represented by the current element (prefix of all contained items)- Returns:
- the values
- Throws:
Exception
- if an error occurs
-
extractValue
Description copied from interface:ValuesExtractor
Extracts the value at the given path- Specified by:
extractValue
in interfaceValuesExtractor
- Type Parameters:
T
- type of the value to retrieve- Parameters:
dataPath
- the data path- Returns:
- the value at the given path
- Throws:
Exception
- if an error occurs
-
_extractValue
protected <T> T _extractValue(Element currentElement, String relativeDataPath, String prefix) throws Exception Extracts the value at the given path- Type Parameters:
T
- type of the value to retrieve- Parameters:
currentElement
- the DOM element containing the items' valuesrelativeDataPath
- The data path relative to the current elementprefix
- the path of the item represented by the current element (prefix of all contained items)- Returns:
- the value
- Throws:
Exception
- if an error occurs
-