Interface DataHolder
-
- All Known Subinterfaces:
CommentableContent
,Composite
,Content
,DataAwareAmetysObject
,MetadataAwarePagesContainer
,ModelAwareDataAwareAmetysObject
,ModelAwareDataHolder
,ModelAwareJCRAmetysObject
,ModelLessDataAwareAmetysObject
,ModelLessDataHolder
,ModelLessJCRAmetysObject
,ModifiableComposite
,ModifiableContent
,ModifiableDataHolder
,ModifiableModelAwareDataAwareAmetysObject
,ModifiableModelAwareDataHolder
,ModifiableModelLessDataAwareAmetysObject
,ModifiableModelLessDataHolder
,ModifiablePage
,ModifiableRepeaterEntry
,ModifiableWebContent
,ModifiableWorkflowAwareContent
,ModifiableZone
,ModifiableZoneItem
,Page
,ProgramPart
,RepeaterEntry
,SharedContent
,TraversableProgramPart
,WebContent
,WorkflowAwareContent
,Zone
,ZoneItem
- All Known Implementing Classes:
AbstractBlogPage
,AbstractComposite
,AbstractLevelPage
,AbstractOdfPage
,AbstractProgram
,AbstractProgramPart
,AbstractRepeaterEntry
,AbstractSurveyElement
,AbstractTraversableProgramPart
,Catalog
,Container
,ContentBackupAmetysObject
,ContentValue
,Course
,CourseList
,CoursePage
,CoursePart
,CourseZone
,CourseZoneItem
,DefaultContent
,DefaultModelAwareDataHolder
,DefaultModelLessDataHolder
,DefaultModifiableModelAwareDataHolder
,DefaultModifiableModelLessDataHolder
,DefaultPage
,DefaultSharedContent
,DefaultWebContent
,DefaultWorkflowAwareContent
,DefaultZone
,DefaultZoneItem
,FirstLevelPage
,FirstLevelZone
,FirstLevelZoneItem
,JCRProjectMember
,ModelAwareComposite
,ModelAwareRepeaterEntry
,ModelLessComposite
,ModifiableDefaultContent
,ModifiableDefaultWebContent
,ModifiableModelAwareComposite
,ModifiableModelAwareRepeaterEntry
,ModifiableModelLessComposite
,OrgUnit
,OrgUnitPage
,OrgUnitZone
,OrgUnitZoneItem
,Person
,PostListZone
,PostListZoneItem
,PostZone
,PostZoneItem
,Program
,ProgramPage
,ProgramZone
,ProgramZoneItem
,Project
,RedirectPage
,SecondLevelPage
,SecondLevelZone
,SecondLevelZoneItem
,Site
,Sitemap
,StaticZone
,StaticZoneItem
,SubProgram
,Survey
,SurveyPage
,SurveyQuestion
,TransitionalPage
,TransitionalZone
,TransitionalZoneItem
,UGCPage
,UGCTransitionalPage
,UGCTransitionalZone
,UGCTransitionalZoneItem
,UGCZone
,UGCZoneItem
,UserPage
,UserZone
,UserZoneItem
,VirtualMonthPage
,VirtualPostPage
,VirtualPostsPage
,VirtualTagPage
,VirtualTagsPage
,VirtualYearPage
,VirtualYearsPage
public interface DataHolder
Interface for data containers
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
copyTo(ModifiableDataHolder dataHolder)
Copies the currentDataHolder
to the givenModifiableModelAwareDataHolder
.default void
dataToSAX(ContentHandler contentHandler, String dataPath)
Generates SAX events for the data at the given data path in the currentDataHolder
Do not generate any event if there is no values at the given pathvoid
dataToSAX(ContentHandler contentHandler, String dataPath, Locale locale)
Generates SAX events for the data at the given data path in the currentDataHolder
Do not generate any event if there is no values at the given pathComposite
getComposite(String compositePath)
Retrieves the composite at the given pathCollection<String>
getDataNames()
Retrieves the names of data contained by this data holder Retrieves only the data at first level, does not check composite dataRepositoryData
getRepositoryData()
Retrieves the repository data used by thisDataHolder
boolean
hasValue(String dataPath)
Checks if there is a value for the data at the given path
-
-
-
Method Detail
-
getComposite
Composite getComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException
Retrieves the composite at the given path- Parameters:
compositePath
- path of the composite to retrieve- Returns:
- the composite or
null
if not exists or is empty - Throws:
IllegalArgumentException
- if the given composite path is null or emptyBadItemTypeException
- if the stored value at the given path is not a composite
-
hasValue
boolean hasValue(String dataPath) throws IllegalArgumentException
Checks if there is a value for the data at the given path- Parameters:
dataPath
- path of the data- Returns:
true
if there is value (even empty) for the data,false
otherwise- Throws:
IllegalArgumentException
- if the given data path is null or empty
-
getDataNames
Collection<String> getDataNames()
Retrieves the names of data contained by this data holder Retrieves only the data at first level, does not check composite data- Returns:
- the names of all data contained by this data holder
-
copyTo
default void copyTo(ModifiableDataHolder dataHolder) throws UndefinedItemPathException, BadItemTypeException, UnknownTypeException, NotUniqueTypeException
Copies the currentDataHolder
to the givenModifiableModelAwareDataHolder
.- 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 destinationModifiableModelAwareDataHolder
BadItemTypeException
- if the type defined by the model of the destinationModifiableModelAwareDataHolder
doesn't match the copied valueUnknownTypeException
- if there is no available type compatible with the copied value for the type extension point of the destinationModifiableModelLessDataHolder
NotUniqueTypeException
- 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) throws SAXException, IOException
Generates SAX events for the data at the given data path in the currentDataHolder
Do not generate any event if there is no values at the given path- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventsdataPath
- the path of the data to SAX- Throws:
SAXException
- if an error occurs during the SAX events generationIOException
- if an error occurs while reading a value using the I/O API
-
dataToSAX
void dataToSAX(ContentHandler contentHandler, String dataPath, Locale locale) throws SAXException, IOException
Generates SAX events for the data at the given data path in the currentDataHolder
Do not generate any event if there is no values at the given path- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventsdataPath
- the path of the data to SAXlocale
- The locale to use for localized data, such asMultilingualString
. Can benull
to generate SAX events for all existingLocale
s.- Throws:
SAXException
- if an error occurs during the SAX events generationIOException
- if an error occurs while reading a value using the I/O API
-
getRepositoryData
RepositoryData getRepositoryData()
Retrieves the repository data used by thisDataHolder
- Returns:
- the repository data used by this
DataHolder
-
-