Package org.opensaml.core.xml.util
Class IDIndex
java.lang.Object
org.opensaml.core.xml.util.IDIndex
Class which provides storage for the ID-to-XMLObject index mapping on an owning
XMLObject
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deregister an ID-to-XMLObject mapping for one of this object's owner's children.void
deregisterIDMappings
(IDIndex idIndex) Deregister multiple ID-to-XMLObject mappings for this object's owner's children.Get the ID-to-XMLObject mappings for this object's owner's children.getIDs()
Get the set of ID strings which are the index keys.boolean
isEmpty()
Return whether the index is currently empty.Lookup and return the XMLObject identified by the specified ID attribute.void
registerIDMapping
(String id, XMLObject referent) Register an ID-to-XMLObject mapping for one of this object's owner's children.void
registerIDMappings
(IDIndex idIndex) Register multiple ID-to-XMLObject mappings for this object's owner's children.
-
Field Details
-
owner
The XMLObject which owns this ID index. -
idMappings
Mapping of ID attributes to XMLObjects in the subtree rooted at this object's owner. This allows constant-time dereferencing of ID-typed attributes within the subtree.
-
-
Constructor Details
-
IDIndex
Constructor.- Parameters:
newOwner
- the XMLObject which owns this ID-to-XMLObject index
-
-
Method Details
-
registerIDMapping
Register an ID-to-XMLObject mapping for one of this object's owner's children.- Parameters:
id
- the XMLObject child's ID attribute valuereferent
- the XMLObject child
-
registerIDMappings
Register multiple ID-to-XMLObject mappings for this object's owner's children.- Parameters:
idIndex
- the ID-to-XMLObject mapping to register
-
deregisterIDMapping
Deregister an ID-to-XMLObject mapping for one of this object's owner's children.- Parameters:
id
- the ID attribute value of the XMLObject child to deregister
-
deregisterIDMappings
Deregister multiple ID-to-XMLObject mappings for this object's owner's children.- Parameters:
idIndex
- the ID-to-XMLObject mappings to deregister
-
lookup
Lookup and return the XMLObject identified by the specified ID attribute.- Parameters:
id
- the ID attribute value to lookup- Returns:
- the XMLObject identified by the ID attribute value
-
isEmpty
public boolean isEmpty()Return whether the index is currently empty.- Returns:
- true if the index is currently empty
-
getIDs
Get the set of ID strings which are the index keys.- Returns:
- the set of ID strings which are keys to the index
-
getIDMappings
Get the ID-to-XMLObject mappings for this object's owner's children.- Returns:
- the ID-to-XMLObject mapping
-