|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.apache.myfaces.trinidadinternal.menu.MenuContentHandlerUsingApiImpl
public class MenuContentHandlerUsingApiImpl
Handler called by the SAXParser when parsing menu metadata as part of the XML Menu Model of Trinidad Faces.
This is called through the Services API (See XMLMenuModel.java) to keep the separation between API's and internal modules.
startElement() and endElement() are called as one would expect, at the start of parsing an element in the menu metadata file and at the end of parsing an element in the menu metadata file. The menu model is created as a List of itemNodes and groupNodes which is available to and used by the XMLMenuModel to create the TreeModel and internal Maps.
| Constructor Summary | |
|---|---|
MenuContentHandlerUsingApiImpl()
Constructs a Menu Content Handler. |
|
| Method Summary | |
|---|---|
void |
endDocument()
Called by the SAX Parser at the end of parsing a document. |
void |
endElement(java.lang.String nameSpaceUri,
java.lang.String localElemName,
java.lang.String qualifiedElemName)
Processing done at the end of parsing a node enty element from the menu metadata file. |
int |
getId()
|
java.util.Map<java.lang.String,java.lang.Object> |
getIdNodeMap(java.lang.Object modelKey)
Get the Model's idNodeMap |
org.apache.myfaces.trinidad.model.XMLMenuModel |
getModel()
Get the local (sharedNode) menu model. |
java.lang.String |
getModelId()
Get the local (sharedNode) menu model's Uri. |
java.util.Map<java.lang.Object,java.util.List<java.lang.Object>> |
getNodeFocusPathMap(java.lang.Object modelKey)
Get the Model's nodeFocusPathMap |
org.apache.myfaces.trinidad.model.XMLMenuModel |
getRootModel()
Get the top-level, root menu model, which contains the entire menu tree. |
java.lang.String |
getRootModelKey()
Get the top-level, root menu model's Request Map Key. |
org.apache.myfaces.trinidad.model.TreeModel |
getTreeModel(java.lang.String uri)
Get the treeModel built during parsing |
java.util.Map<java.lang.String,java.util.List<java.lang.Object>> |
getViewIdFocusPathMap(java.lang.Object modelKey)
Get the Model's viewIdFocusPathMap |
void |
setId(int id)
sets the id of this content handler No synchronization necessary,let the first thread set the id, the rest of the threads will immediately see the new value and will not try to set again. |
void |
setModelId(java.lang.String localModelId)
Sets the local (sharedNode's) menu Model's System Id. |
void |
setRootHandler(boolean isRoot)
|
void |
setRootModelKey(java.lang.String rootModelKey)
Sets the root menu Model's Request map key. |
void |
setTreeModelKey(java.lang.String uri)
Sets the treeModel map key used to get a cached treeModel from the MenuContentHandlerUsingApiImpl. |
void |
startDocument()
Called by the SAX Parser at the start of parsing a document. |
void |
startElement(java.lang.String nameSpaceUri,
java.lang.String localElemName,
java.lang.String qualifiedElemName,
org.xml.sax.Attributes attrList)
Start the parsing of an node element entry in the menu metadata file. |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
characters, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MenuContentHandlerUsingApiImpl()
| Method Detail |
|---|
public void startDocument()
startDocument in interface org.xml.sax.ContentHandlerstartDocument in class org.xml.sax.helpers.DefaultHandler
public void startElement(java.lang.String nameSpaceUri,
java.lang.String localElemName,
java.lang.String qualifiedElemName,
org.xml.sax.Attributes attrList)
throws org.xml.sax.SAXException
If the entry is for an itemNode or a destinationNode, create the node and it to the List. If the entry is for a sharedNode, a new submenu model is created.
startElement in interface org.xml.sax.ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlernameSpaceUri - - only used when passed to super class.localElemName - - only used when passed to super class.qualifiedElemName - - String designating the node type of the entry.attrList - - List of attributes in the menudata entry.
org.xml.sax.SAXException
public void endElement(java.lang.String nameSpaceUri,
java.lang.String localElemName,
java.lang.String qualifiedElemName)
endElement in interface org.xml.sax.ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandlernameSpaceUri - - not used.localElemName - - not used.qualifiedElemName - - String designating the node type of the entry.public void endDocument()
endDocument in interface org.xml.sax.ContentHandlerendDocument in class org.xml.sax.helpers.DefaultHandlerpublic java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getViewIdFocusPathMap(java.lang.Object modelKey)
getViewIdFocusPathMap in interface org.apache.myfaces.trinidad.model.XMLMenuModel.MenuContentHandlerpublic java.util.Map<java.lang.Object,java.util.List<java.lang.Object>> getNodeFocusPathMap(java.lang.Object modelKey)
getNodeFocusPathMap in interface org.apache.myfaces.trinidad.model.XMLMenuModel.MenuContentHandlerpublic java.util.Map<java.lang.String,java.lang.Object> getIdNodeMap(java.lang.Object modelKey)
getIdNodeMap in interface org.apache.myfaces.trinidad.model.XMLMenuModel.MenuContentHandlerpublic org.apache.myfaces.trinidad.model.TreeModel getTreeModel(java.lang.String uri)
getTreeModel in interface org.apache.myfaces.trinidad.model.XMLMenuModel.MenuContentHandlerpublic org.apache.myfaces.trinidad.model.XMLMenuModel getRootModel()
public java.lang.String getRootModelKey()
public void setRootModelKey(java.lang.String rootModelKey)
This is always only the top-level, root model's Request map key. We do this because the MenuContentHandlerUsingApiImpl and nodes need to be able to call into the root model to:
setRootModelKey in interface org.apache.myfaces.trinidad.model.XMLMenuModel.MenuContentHandlerrootModelKey - - String the root, top-level menu model's Request
map key.public org.apache.myfaces.trinidad.model.XMLMenuModel getModel()
public java.lang.String getModelId()
public void setModelId(java.lang.String localModelId)
setModelId in interface org.apache.myfaces.trinidad.model.XMLMenuModel.MenuContentHandlerlocalModelId - - String the root, top-level menu model's Uri.public void setTreeModelKey(java.lang.String uri)
uri - String path to the menu model's metadatapublic void setRootHandler(boolean isRoot)
setRootHandler in interface org.apache.myfaces.trinidad.model.XMLMenuModel.MenuContentHandlerpublic void setId(int id)
setId in interface org.apache.myfaces.trinidad.model.XMLMenuModel.MenuContentHandlerpublic int getId()
getId in interface org.apache.myfaces.trinidad.model.XMLMenuModel.MenuContentHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||