MethodNodepublic class MethodNode extends DeploymentDescriptorNode This class handle the method element |
Methods Summary |
---|
public boolean | endElement(XMLElement element)receives notification of the end of an XML element by the Parser
String qname = element.getQName();
if (EjbTagNames.METHOD_PARAMS.equals(qname)) {
MethodDescriptor desc = (MethodDescriptor) getDescriptor();
// this means we have an empty method-params element
// which means this method has no input parameter
if (desc.getParameterClassNames() == null) {
desc.setEmptyParameterClassNames();
}
}
return super.endElement(element);
| 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.
Map table = super.getDispatchTable();
table.put(EjbTagNames.EJB_NAME, "setEjbName");
table.put(EjbTagNames.METHOD_INTF, "setEjbClassSymbol");
table.put(EjbTagNames.METHOD_NAME, "setName");
table.put(EjbTagNames.METHOD_PARAM, "addParameterClass");
return table;
| public org.w3c.dom.Node | writeDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.MethodDescriptor descriptor, java.lang.String ejbName)write the method descriptor class to a query-method DOM tree and return it
Node methodNode = super.writeDescriptor(parent, nodeName, descriptor);
writeLocalizedDescriptions(methodNode, descriptor);
if (ejbName != null && ejbName.length() > 0) {
appendTextChild(methodNode, EjbTagNames.EJB_NAME, ejbName);
}
String methodIntfSymbol = descriptor.getEjbClassSymbol();
if( (methodIntfSymbol != null) &&
!methodIntfSymbol.equals(MethodDescriptor.EJB_BEAN) ) {
appendTextChild(methodNode, EjbTagNames.METHOD_INTF,
methodIntfSymbol);
}
appendTextChild(methodNode, EjbTagNames.METHOD_NAME, descriptor.getName());
if (descriptor.getParameterClassNames()!=null) {
Node paramsNode = appendChild(methodNode, EjbTagNames.METHOD_PARAMS);
writeMethodParams(paramsNode, descriptor);
}
return methodNode;
| public org.w3c.dom.Node | writeJavaMethodDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.MethodDescriptor descriptor)write the method descriptor class to a java-method DOM tree and return it
// Write out the java method description. In the case of a void
// method, a <method-params> element will *not* be written out.
return writeJavaMethodDescriptor(parent, nodeName, descriptor, false);
| public org.w3c.dom.Node | writeJavaMethodDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.MethodDescriptor descriptor, boolean writeEmptyMethodParamsElementForVoidMethods)write the method descriptor class to a java-method DOM tree and return it
Node methodNode = super.writeDescriptor(parent, nodeName, descriptor);
appendTextChild(methodNode, RuntimeTagNames.METHOD_NAME,
descriptor.getName());
if (descriptor.getParameterClassNames() != null) {
Node paramsNode =
appendChild(methodNode, RuntimeTagNames.METHOD_PARAMS);
writeMethodParams(paramsNode, descriptor);
} else {
if( writeEmptyMethodParamsElementForVoidMethods ) {
appendChild(methodNode, RuntimeTagNames.METHOD_PARAMS);
}
}
return methodNode;
| private void | writeMethodParams(org.w3c.dom.Node paramsNode, com.sun.enterprise.deployment.MethodDescriptor descriptor)writes the method parameters to the DOM Tree
String[] params = descriptor.getParameterClassNames();
if (params==null)
return;
for (int i=0; i<params.length;i++) {
appendTextChild(paramsNode, RuntimeTagNames.METHOD_PARAM, params[i]);
}
| public org.w3c.dom.Node | writeQueryMethodDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.MethodDescriptor descriptor)write the method descriptor class to a query-method DOM tree and return it
Node methodNode = super.writeDescriptor(parent, nodeName, descriptor);
appendTextChild(methodNode, EjbTagNames.METHOD_NAME, descriptor.getName());
Node paramsNode = appendChild(methodNode, EjbTagNames.METHOD_PARAMS);
writeMethodParams(paramsNode, descriptor);
return methodNode;
|
|