Package org.opencms.acacia.client
Class CmsRootHandler
- java.lang.Object
-
- org.opencms.acacia.client.CmsRootHandler
-
- All Implemented Interfaces:
I_CmsAttributeHandler
- Direct Known Subclasses:
CmsAttributeHandler
public class CmsRootHandler extends java.lang.Object implements I_CmsAttributeHandler
The root attribute handler.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<java.util.Map<java.lang.String,CmsAttributeHandler>>
m_handlers
The sub handlers.
-
Constructor Summary
Constructors Constructor Description CmsRootHandler()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearHandlers()
Clears the handler hierarchy.java.lang.String
collectSimplePath(I_CmsAttributeHandler childHandler)
Returns the simple path.void
ensureHandlers(int index)
Ensures attribute handler maps are available up to the specified index.java.lang.String
getAttributeName()
Returns the attribute name.CmsAttributeHandler
getChildHandler(java.lang.String attributeName, int index)
Returns the handler for the given attribute at the given index.CmsAttributeHandler
getChildHandlerBySimpleName(java.lang.String name, int index)
Returns the child handler by simple name.CmsAttributeHandler
getHandlerById(java.lang.String entityId, java.lang.String attributeName)
Returns the handler for the given id.CmsAttributeHandler
getHandlerByPath(java.lang.String[] pathNames)
Returns the attribute handler for the given path.CmsAttributeHandler
getHandlersBySimplePath(java.lang.String[] pathNames)
Returns the attribute handler to the given simple path.protected void
initHandlers(int count)
Initializes the sub handlers maps for the given value count.void
insertHandlers(int index)
Inserts a handler map at the given index.void
removeHandlers(int index)
Removes the handlers at the given index.void
setHandler(int index, java.lang.String attributeName, CmsAttributeHandler handler)
Sets a child attribute handler.void
setHandlerById(java.lang.String attributeName, CmsAttributeHandler handler)
Sets the handler by id.void
visit(java.util.function.Consumer<I_CmsAttributeHandler> handler)
Recruses over all child handlers of this handler and passes them to a callback.
-
-
-
Field Detail
-
m_handlers
protected java.util.List<java.util.Map<java.lang.String,CmsAttributeHandler>> m_handlers
The sub handlers.
-
-
Constructor Detail
-
CmsRootHandler
public CmsRootHandler()
Constructor.
-
-
Method Detail
-
clearHandlers
public void clearHandlers()
Clears the handler hierarchy.
-
collectSimplePath
public java.lang.String collectSimplePath(I_CmsAttributeHandler childHandler)
Description copied from interface:I_CmsAttributeHandler
Returns the simple path.- Specified by:
collectSimplePath
in interfaceI_CmsAttributeHandler
- Parameters:
childHandler
- the child attribute handler- Returns:
- the simple path
- See Also:
I_CmsAttributeHandler.collectSimplePath(org.opencms.acacia.client.I_CmsAttributeHandler)
-
ensureHandlers
public void ensureHandlers(int index)
Ensures attribute handler maps are available up to the specified index.This is required during inline editing, where only a fragment of the handlers data structure is build and used.
- Parameters:
index
- the index of the currently edited attribute
-
getAttributeName
public java.lang.String getAttributeName()
Description copied from interface:I_CmsAttributeHandler
Returns the attribute name.- Specified by:
getAttributeName
in interfaceI_CmsAttributeHandler
- Returns:
- the attribute name
- See Also:
I_CmsAttributeHandler.getAttributeName()
-
getChildHandler
public CmsAttributeHandler getChildHandler(java.lang.String attributeName, int index)
Description copied from interface:I_CmsAttributeHandler
Returns the handler for the given attribute at the given index.- Specified by:
getChildHandler
in interfaceI_CmsAttributeHandler
- Parameters:
attributeName
- the attribute nameindex
- the value index- Returns:
- the handler
- See Also:
I_CmsAttributeHandler.getChildHandler(java.lang.String, int)
-
getChildHandlerBySimpleName
public CmsAttributeHandler getChildHandlerBySimpleName(java.lang.String name, int index)
Description copied from interface:I_CmsAttributeHandler
Returns the child handler by simple name.- Specified by:
getChildHandlerBySimpleName
in interfaceI_CmsAttributeHandler
- Parameters:
name
- the nameindex
- the value index- Returns:
- the child handler if present
- See Also:
I_CmsAttributeHandler.getChildHandlerBySimpleName(java.lang.String, int)
-
getHandlerById
public CmsAttributeHandler getHandlerById(java.lang.String entityId, java.lang.String attributeName)
Returns the handler for the given id.- Parameters:
entityId
- the entity idattributeName
- the attribute name- Returns:
- the handler
-
getHandlerByPath
public CmsAttributeHandler getHandlerByPath(java.lang.String[] pathNames)
Returns the attribute handler for the given path.- Parameters:
pathNames
- the path names- Returns:
- the attribute handler
-
getHandlersBySimplePath
public CmsAttributeHandler getHandlersBySimplePath(java.lang.String[] pathNames)
Returns the attribute handler to the given simple path.- Parameters:
pathNames
- the simple path elements- Returns:
- the attribute handler
-
insertHandlers
public void insertHandlers(int index)
Description copied from interface:I_CmsAttributeHandler
Inserts a handler map at the given index.- Specified by:
insertHandlers
in interfaceI_CmsAttributeHandler
- Parameters:
index
- the value index- See Also:
I_CmsAttributeHandler.insertHandlers(int)
-
removeHandlers
public void removeHandlers(int index)
Description copied from interface:I_CmsAttributeHandler
Removes the handlers at the given index.- Specified by:
removeHandlers
in interfaceI_CmsAttributeHandler
- Parameters:
index
- the value index- See Also:
I_CmsAttributeHandler.removeHandlers(int)
-
setHandler
public void setHandler(int index, java.lang.String attributeName, CmsAttributeHandler handler)
Description copied from interface:I_CmsAttributeHandler
Sets a child attribute handler.- Specified by:
setHandler
in interfaceI_CmsAttributeHandler
- Parameters:
index
- the value indexattributeName
- the attribute namehandler
- the handler- See Also:
I_CmsAttributeHandler.setHandler(int, java.lang.String, org.opencms.acacia.client.CmsAttributeHandler)
-
setHandlerById
public void setHandlerById(java.lang.String attributeName, CmsAttributeHandler handler)
Description copied from interface:I_CmsAttributeHandler
Sets the handler by id.- Specified by:
setHandlerById
in interfaceI_CmsAttributeHandler
- Parameters:
attributeName
- the attribute namehandler
- the handler- See Also:
I_CmsAttributeHandler.setHandlerById(java.lang.String, org.opencms.acacia.client.CmsAttributeHandler)
-
visit
public void visit(java.util.function.Consumer<I_CmsAttributeHandler> handler)
Recruses over all child handlers of this handler and passes them to a callback.- Parameters:
handler
- the handler whose child handlers should be processed
-
initHandlers
protected void initHandlers(int count)
Initializes the sub handlers maps for the given value count.- Parameters:
count
- the value count
-
-