Interface Composite
- All Superinterfaces:
DataHolder
- All Known Subinterfaces:
IndexableComposite,IndexableRepeaterEntry,ModelAwareComposite,ModelAwareRepeaterEntry,ModelLessComposite,ModifiableComposite,ModifiableIndexableComposite,ModifiableIndexableRepeaterEntry,ModifiableModelAwareComposite,ModifiableModelAwareRepeaterEntry,ModifiableModelLessComposite,ModifiableRepeaterEntry,RepeaterEntry
- All Known Implementing Classes:
DefaultModelAwareComposite,DefaultModelAwareRepeaterEntry,DefaultModelLessComposite,DefaultModifiableModelAwareComposite,DefaultModifiableModelAwareRepeaterEntry,DefaultModifiableModelLessComposite
Interface for composites
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidcopyTo(ModifiableDataHolder dataHolder) Copies the currentDataHolderto the givenModifiableModelAwareDataHolder.default ObjectdataToJSON(String dataPath, DataContext context) Convert the data at the given path into a JSON objectdefault voiddataToSAX(ContentHandler contentHandler, String dataPath, DataContext context) Generates SAX events for the data at the given data path in the currentDataHolderDo not generate any event if there is no values at the given pathdefault Collection<String>Retrieves the names of data contained by this data holder Retrieves only the data at first level, does not check composite dataRetrieves the default implementation of aDataHolderto usedefault booleanChecks if there is a non empty value for the data at the given pathdefault booleanhasValueOrEmpty(String dataPath) Checks if there is a value, even empty, for the data at the given pathMethods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
dataToJSON, dataToSAX, getComposite, getParentDataHolder, getRepositoryData, getRootDataHolder
-
Method Details
-
hasValue
Description copied from interface:DataHolderChecks if there is a non empty value for the data at the given path- Specified by:
hasValuein interfaceDataHolder- Parameters:
dataPath- path of the data- Returns:
trueif there is a non empty value for the data,falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or empty
-
hasValueOrEmpty
Description copied from interface:DataHolderChecks if there is a value, even empty, for the data at the given path- Specified by:
hasValueOrEmptyin interfaceDataHolder- Parameters:
dataPath- path of the data- Returns:
trueif there is value, even empty, for the data,falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or empty
-
getDataNames
Description copied from interface:DataHolderRetrieves the names of data contained by this data holder Retrieves only the data at first level, does not check composite data- Specified by:
getDataNamesin interfaceDataHolder- Returns:
- the names of all data contained by this data holder
-
copyTo
default void copyTo(ModifiableDataHolder dataHolder) throws UndefinedItemPathException, BadItemTypeException, UnknownTypeException, NotUniqueTypeException Description copied from interface:DataHolderCopies the currentDataHolderto the givenModifiableModelAwareDataHolder.- Specified by:
copyToin interfaceDataHolder- Parameters:
dataHolder- The destination dataHolder. Can not be null.- Throws:
UndefinedItemPathException- if one of the copied data is not defined by the model of the destinationModifiableModelAwareDataHolderBadItemTypeException- if the type defined by the model of the destinationModifiableModelAwareDataHolderdoesn't match the copied valueUnknownTypeException- if there is no available type compatible with the copied value for the type extension point of the destinationModifiableModelLessDataHolderNotUniqueTypeException- if there is more than one available types compatibles with the copied value for the type extension point of the destinationModifiableModelLessDataHolder
-
dataToSAX
default void dataToSAX(ContentHandler contentHandler, String dataPath, DataContext context) throws SAXException Description copied from interface:DataHolderGenerates SAX events for the data at the given data path in the currentDataHolderDo not generate any event if there is no values at the given path- Specified by:
dataToSAXin interfaceDataHolder- Parameters:
contentHandler- theContentHandlerthat will receive the SAX eventsdataPath- the path of the data to SAXcontext- The context of the data to SAX- Throws:
SAXException- if an error occurs during the SAX events generation
-
dataToJSON
Description copied from interface:DataHolderConvert the data at the given path into a JSON object- Specified by:
dataToJSONin interfaceDataHolder- Parameters:
dataPath- the path of the data to convertcontext- The context of the data to convert- Returns:
- The value as JSON
-
getDefaultDataHolder
Retrieves the default implementation of aDataHolderto use- Returns:
- the
DataHolder
-