|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.deployment.node.DeploymentDescriptorNode<T>
public abstract class DeploymentDescriptorNode<T>
Superclass of all Nodes implementation XMLNode implementation represents all the DOL classes responsible for handling the XML deployment descriptors. These nodes are called by the SAX parser when reading and are constructed to build the DOM tree for saving the XML files. XMLNode are orgnalized like a tree with one root XMLNode (which implement the RootXMLNode interface) and sub XMLNodes responsible for handling subparts of the XML documents. Sub XMLNodes register themselfves to their parent XMLNode as handlers for a particular XML subtag of the tag handled by the parent XMLNode Each XMLNode is therefore associated with a xml tag (located anywhere in the tree of tags as defined by the DTD). It owns the responsibility for reading and writing the tag, its attributes and all subtags (by using delegation to sub XMLNode if necessary).
| Field Summary | |
|---|---|
protected java.lang.Object |
abstractDescriptor
|
protected java.util.Hashtable |
handlers
|
protected static LocalStringManagerImpl |
localStrings
|
protected XMLNode |
parentNode
|
| Constructor Summary | |
|---|---|
DeploymentDescriptorNode()
Creates new DeploymentDescriptorNode |
|
| Method Summary | |
|---|---|
void |
addDescriptor(java.lang.Object descriptor)
Adds a new DOL descriptor instance to the descriptor instance associated with this XMLNode |
protected void |
addNamespaceDeclaration(org.w3c.dom.Element node,
Descriptor descriptor)
Any node can now declare its own namespace. |
protected void |
addNodeDescriptor(DeploymentDescriptorNode node)
Adds a new DOL descriptor instance to the descriptor associated with this XMLNode |
void |
addPrefixMapping(java.lang.String prefix,
java.lang.String uri)
notify of a new prefix mapping used in this document |
static org.w3c.dom.Element |
appendChild(org.w3c.dom.Node parent,
java.lang.String elementName)
Append a new element child to the current node |
void |
appendQNameChild(java.lang.String elementName,
org.w3c.dom.Node parent,
java.lang.String namespaceUri,
java.lang.String localPart,
java.lang.String prefix)
|
static org.w3c.dom.Node |
appendTextChild(org.w3c.dom.Node parent,
java.lang.String elementName,
int value)
Append a new text child |
static org.w3c.dom.Node |
appendTextChild(org.w3c.dom.Node parent,
java.lang.String elementName,
java.lang.String text)
Append a new text child |
java.lang.String |
composeQNameValue(java.lang.String prefix,
java.lang.String localPart)
|
boolean |
endElement(XMLElement element)
receives notification of the end of an XML element by the Parser |
static org.w3c.dom.Node |
forceAppendTextChild(org.w3c.dom.Node parent,
java.lang.String elementName,
java.lang.String text)
Append a new text child even if text is empty |
T |
getDescriptor()
|
protected java.util.Map |
getDispatchTable()
all sub-implementation of this class can use a dispatch table to map xml element to method name on the descriptor class for setting the element value. |
XMLNode |
getHandlerFor(XMLElement element)
Return the XMLNode implementation respionsible for handling the sub-element of the current node |
java.lang.String |
getLocalPartFromQName(java.lang.String qname)
Return local part from qname, where qname is an xsd:QName. |
protected static org.w3c.dom.Document |
getOwnerDocument(org.w3c.dom.Node node)
|
XMLNode |
getParentNode()
|
java.lang.String |
getPrefixFromQName(java.lang.String qname)
|
java.lang.String |
getXMLPath()
|
protected XMLElement |
getXMLRootTag()
|
boolean |
handlesElement(XMLElement element)
Return true if the XMLNode is responisble for handling the XML element |
void |
postParsing()
notification of the end of XML parsing for this node |
protected void |
registerElementHandler(XMLElement element,
java.lang.Class handler)
register a new XMLNode handler for a particular XML tag. |
protected void |
registerElementHandler(XMLElement element,
java.lang.Class handler,
java.lang.String addMethodName)
register a new XMLNode handler for a particular XML tag. |
java.lang.String |
resolvePrefix(XMLElement element,
java.lang.String prefix)
Resolve a QName prefix to its corresponding Namespace URI by searching up node chain starting with child. |
static void |
setAttribute(org.w3c.dom.Element parent,
java.lang.String elementName,
java.lang.String text)
Append a new attribute to an element |
static void |
setAttributeNS(org.w3c.dom.Element element,
java.lang.String prefix,
java.lang.String namespaceURI)
Set a namespace attribute on an element. |
protected boolean |
setAttributeValue(XMLElement elementName,
XMLElement attributeName,
java.lang.String value)
parsed an attribute of an element |
protected void |
setDescriptorInfo(java.lang.Object target,
java.lang.String methodName,
java.lang.String value)
call a setter method on a descriptor with a new value |
void |
setElementValue(XMLElement element,
java.lang.String value)
receives notification of the value for a particular tag |
void |
setParentNode(XMLNode parentNode)
set the parent node for the current instance. |
protected void |
setXMLRootTag(XMLElement element)
sets the XML tag associated with this XMLNode |
void |
startElement(XMLElement element,
org.xml.sax.Attributes attributes)
SAX Parser API implementation, we don't really care for now. |
protected void |
writeAroundInvokeDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator aroundInvokeDescs)
|
protected void |
writeAroundTimeoutDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator aroundTimeoutDescs)
|
protected void |
writeDataSourceDefinitionDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator<DataSourceDefinitionDescriptor> dsDefinitionDescIterator)
write a list of datasource-definition descriptors to a DOM Tree |
org.w3c.dom.Node |
writeDescriptor(org.w3c.dom.Node parent,
java.lang.String nodeName,
T descriptor)
write the descriptor class to a DOM tree and return it |
org.w3c.dom.Node |
writeDescriptor(org.w3c.dom.Node parent,
T descriptor)
write the descriptor class to a DOM tree and return it |
protected void |
writeEjbReferenceDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator refs)
write the ejb references (local or remote) to the DOM tree |
protected void |
writeEntityManagerFactoryReferenceDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator entityMgrFactoryRefs)
write a list of entity manager factory reference descriptors to a DOM Tree |
protected void |
writeEntityManagerReferenceDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator entityMgrRefs)
write a list of entity manager reference descriptors to a DOM Tree |
protected void |
writeEnvEntryDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator envEntries)
write a list of env entry descriptors to a DOM Tree |
protected void |
writeJNDIEnvironmentRefs(org.w3c.dom.Node node,
JndiNameEnvironment descriptor)
writes jndi environment references group nodes |
protected void |
writeLocalizedDescriptions(org.w3c.dom.Node node,
Descriptor desc)
writes iocalized descriptions (if any) to the DOM node |
protected void |
writeMessageDestinationRefDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator msgDestRefs)
write a list of message destination reference descriptors to a DOM Tree |
protected void |
writePostActivateDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator postActivateDescs)
|
protected void |
writePostConstructDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator<LifecycleCallbackDescriptor> postConstructDescs)
write a list of post-construct descriptors to a DOM Tree |
protected void |
writePreDestroyDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator<LifecycleCallbackDescriptor> preDestroyDescs)
write a list of pre-destroy descriptors to a DOM Tree |
protected void |
writePrePassivateDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator prePassivateDescs)
|
protected void |
writeResourceEnvRefDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator resRefs)
write a list of resource env reference descriptors to a DOM Tree |
protected void |
writeResourceRefDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator resRefs)
write a list of resource reference descriptors to a DOM Tree |
protected void |
writeServiceReferenceDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator refs)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Hashtable handlers
protected XMLNode parentNode
protected java.lang.Object abstractDescriptor
protected static final LocalStringManagerImpl localStrings
| Constructor Detail |
|---|
public DeploymentDescriptorNode()
| Method Detail |
|---|
public T getDescriptor()
getDescriptor in interface XMLNode<T>public void addDescriptor(java.lang.Object descriptor)
addDescriptor in interface XMLNode<T>descriptor - the new descriptorprotected void addNodeDescriptor(DeploymentDescriptorNode node)
node - the sub-node adding the descriptor;public void setParentNode(XMLNode parentNode)
public XMLNode getParentNode()
getParentNode in interface XMLNode<T>
protected void registerElementHandler(XMLElement element,
java.lang.Class handler)
element - XMLElement is the XML tag this XMLNode will handlehandler - the class implemenenting the XMLNode interface
protected void registerElementHandler(XMLElement element,
java.lang.Class handler,
java.lang.String addMethodName)
element - XMLElement is the XML tag this XMLNode will handlehandler - the class implemenenting the XMLNode interfaceaddMethodName - is the method name for adding the descriptor
extracted by the handler node to the current descriptorprotected XMLElement getXMLRootTag()
protected void setXMLRootTag(XMLElement element)
public XMLNode getHandlerFor(XMLElement element)
XMLNode
getHandlerFor in interface XMLNode<T>element - the XML element type name
public void startElement(XMLElement element,
org.xml.sax.Attributes attributes)
startElement in interface XMLNode<T>element - the XML element type nameattributes - the specified or defaultted attritutes
protected boolean setAttributeValue(XMLElement elementName,
XMLElement attributeName,
java.lang.String value)
elementName - the element nameattributeName - the attribute namevalue - the attribute value
public boolean endElement(XMLElement element)
endElement in interface XMLNode<T>element - the xml tag identification
public void postParsing()
public boolean handlesElement(XMLElement element)
XMLNode
handlesElement in interface XMLNode<T>element - the XML element type name
public void setElementValue(XMLElement element,
java.lang.String value)
setElementValue in interface XMLNode<T>element - the xml elementvalue - it's associated valueprotected java.util.Map getDispatchTable()
protected void setDescriptorInfo(java.lang.Object target,
java.lang.String methodName,
java.lang.String value)
throws java.lang.NoSuchMethodException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
target - the descriptor to usemethodName - the setter method to invokevalue - the new value for the field in the descriptor
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetExceptionpublic java.lang.String getXMLPath()
getXMLPath in interface XMLNode<T>
public org.w3c.dom.Node writeDescriptor(org.w3c.dom.Node parent,
T descriptor)
writeDescriptor in interface XMLNode<T>parent - node in the DOM treedescriptor - the descriptor to write
public org.w3c.dom.Node writeDescriptor(org.w3c.dom.Node parent,
java.lang.String nodeName,
T descriptor)
parent - node in the DOM treenodeName - name for the root element for this DOM tree fragmentdescriptor - the descriptor to write
protected static org.w3c.dom.Document getOwnerDocument(org.w3c.dom.Node node)
public static org.w3c.dom.Element appendChild(org.w3c.dom.Node parent,
java.lang.String elementName)
Append a new element child to the current node
parent - is the parent node for the new child elementelementName - is new element tag name
public static org.w3c.dom.Node appendTextChild(org.w3c.dom.Node parent,
java.lang.String elementName,
java.lang.String text)
Append a new text child
parent - for the new child elementelementName - is the new element tag nametext - the text for the new element
public static org.w3c.dom.Node appendTextChild(org.w3c.dom.Node parent,
java.lang.String elementName,
int value)
Append a new text child
parent - for the new child elementelementName - is the new element tag namevalue - the int value for the new element
public static org.w3c.dom.Node forceAppendTextChild(org.w3c.dom.Node parent,
java.lang.String elementName,
java.lang.String text)
Append a new text child even if text is empty
parent - for the new child elementelementName - is the new element tag nametext - the text for the new element
public static void setAttribute(org.w3c.dom.Element parent,
java.lang.String elementName,
java.lang.String text)
Append a new attribute to an element
parent - for the new child elementelementName - is the new element tag nametext - the text for the new element
public static void setAttributeNS(org.w3c.dom.Element element,
java.lang.String prefix,
java.lang.String namespaceURI)
element - on which to set attributeprefix - raw prefix (without "xmlns:")namespaceURI - namespace URI to which prefix is mapped.
protected void writeEnvEntryDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator envEntries)
parentNode - parent node for the DOM treeenvEntries - the iterator over the descriptors to write
protected void writeEjbReferenceDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator refs)
parentNode - parent node for the DOM treerefs - the set of EjbReferenceDescriptor to write
protected void writeServiceReferenceDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator refs)
protected void writeResourceRefDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator resRefs)
parentNode - parent node for the DOM treeresRefs - the iterator over the descriptors to write
protected void writeResourceEnvRefDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator resRefs)
parentNode - parent node for the DOM treeresRefs - the iterator over the descriptors to write
protected void writeMessageDestinationRefDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator msgDestRefs)
parentNode - parent node for the DOM treemsgDestRefs - the iterator over the descriptors to write
protected void writeEntityManagerReferenceDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator entityMgrRefs)
parentNode - parent node for the DOM treeentityMgrRefs - the iterator over the descriptors to write
protected void writeEntityManagerFactoryReferenceDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator entityMgrFactoryRefs)
parentNode - parent node for the DOM treeentityMgrFactoryRefs - the iterator over the descriptors to write
protected void writeAroundInvokeDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator aroundInvokeDescs)
protected void writeAroundTimeoutDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator aroundTimeoutDescs)
protected void writePostActivateDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator postActivateDescs)
protected void writePrePassivateDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator prePassivateDescs)
protected void writePostConstructDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator<LifecycleCallbackDescriptor> postConstructDescs)
parentNode - parent node for the DOM treepostConstructDescs - the iterator over the descriptors to write
protected void writePreDestroyDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator<LifecycleCallbackDescriptor> preDestroyDescs)
parentNode - parent node for the DOM treepreDestroyDescs - the iterator over the descriptors to write
protected void writeDataSourceDefinitionDescriptors(org.w3c.dom.Node parentNode,
java.util.Iterator<DataSourceDefinitionDescriptor> dsDefinitionDescIterator)
parentNode - parent node for the DOM treedsDefinitionDescIterator - the iterator over the descriptors to write
protected void writeLocalizedDescriptions(org.w3c.dom.Node node,
Descriptor desc)
protected void writeJNDIEnvironmentRefs(org.w3c.dom.Node node,
JndiNameEnvironment descriptor)
protected void addNamespaceDeclaration(org.w3c.dom.Element node,
Descriptor descriptor)
node - from which this namespace is declareddescriptor - containing the namespace declaration if any
public void addPrefixMapping(java.lang.String prefix,
java.lang.String uri)
addPrefixMapping in interface XMLNode<T>
public java.lang.String resolvePrefix(XMLElement element,
java.lang.String prefix)
resolvePrefix in interface XMLNode<T>public java.lang.String getPrefixFromQName(java.lang.String qname)
public java.lang.String getLocalPartFromQName(java.lang.String qname)
public java.lang.String composeQNameValue(java.lang.String prefix,
java.lang.String localPart)
public void appendQNameChild(java.lang.String elementName,
org.w3c.dom.Node parent,
java.lang.String namespaceUri,
java.lang.String localPart,
java.lang.String prefix)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||