/** * parsed an attribute of an element * * @param the element name * @param the attribute name * @param the attribute value * @return true if the attribute was processed */ protected boolean setAttributeValue(XMLElement elementName, XMLElement attributeName, String value) { getDescriptor(); if (descriptor==null) { throw new RuntimeException( "Trying to set values on a null descriptor"); } // the version attribute value is the spec version we use // and it's only available from schema based xml if (attributeName.getQName().equals(ConnectorTagNames.VERSION)) { descriptor.setSpecVersion(value); specVersion = value; return true; } else if (attributeName.getQName().equals(TagNames.ID)) { // we do not support id attribute for the moment return true; } return false; }
/** * parsed an attribute of an element * * @param the element name * @param the attribute name * @param the attribute value * @return true if the attribute was processed */ protected boolean setAttributeValue(XMLElement elementName, XMLElement attributeName, String value) { getDescriptor(); if (descriptor==null) { throw new RuntimeException( "Trying to set values on a null descriptor"); } // the version attribute value is the spec version we use // and it's only available from schema based xml if (attributeName.getQName().equals(ConnectorTagNames.VERSION)) { descriptor.setSpecVersion(value); specVersion = value; return true; } else if (attributeName.getQName().equals(TagNames.ID)) { // we do not support id attribute for the moment return true; } return false; }
/** * receives notification of the value for a particular tag * * @param element the xml element * @param value it's associated value */ public void setElementValue(XMLElement element, String value) { getDescriptor(); if (descriptor == null) { throw new RuntimeException("Trying to set values on a null descriptor"); } if (ConnectorTagNames.SPEC_VERSION.equals(element.getQName())) { descriptor.setSpecVersion(value); specVersion = value; // the version element value is the resourve adapter version // and it's only available from dtd based xml } else if (ConnectorTagNames.VERSION.equals(element.getQName())) { descriptor.setResourceAdapterVersion(value); } else if(TagNames.MODULE_NAME.equals(element.getQName())) { ConnectorDescriptor bundleDesc = getDescriptor(); bundleDesc.getModuleDescriptor().setModuleName(value); /* bundleDesc.setModuleNameSet(true); */ } else { super.setElementValue(element, value); } }
/** * receives notification of the value for a particular tag * * @param element the xml element * @param value it's associated value */ public void setElementValue(XMLElement element, String value) { getDescriptor(); if (descriptor == null) { throw new RuntimeException("Trying to set values on a null descriptor"); } if (ConnectorTagNames.SPEC_VERSION.equals(element.getQName())) { descriptor.setSpecVersion(value); specVersion = value; // the version element value is the resourve adapter version // and it's only available from dtd based xml } else if (ConnectorTagNames.VERSION.equals(element.getQName())) { descriptor.setResourceAdapterVersion(value); } else if(TagNames.MODULE_NAME.equals(element.getQName())) { ConnectorDescriptor bundleDesc = getDescriptor(); bundleDesc.getModuleDescriptor().setModuleName(value); /* bundleDesc.setModuleNameSet(true); */ } else { super.setElementValue(element, value); } }
/** * write the descriptor class to a DOM tree and return it * * @param parent node for the DOM tree * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor(Node parent, ConnectorDescriptor conDesc) { conDesc.setSpecVersion(VERSION_17); Node connectorNode = super.writeDescriptor(parent, conDesc); appendTextChild(connectorNode, ConnectorTagNames.VENDOR_NAME, conDesc.getVendorName()); appendTextChild(connectorNode, ConnectorTagNames.EIS_TYPE, conDesc.getEisType()); appendTextChild(connectorNode, ConnectorTagNames.RESOURCEADAPTER_VERSION, conDesc.getResourceAdapterVersion()); Iterator requiredInflowContexts = conDesc.getRequiredWorkContexts().iterator(); for (; requiredInflowContexts.hasNext();) { String className = (String) requiredInflowContexts.next(); appendTextChild(connectorNode, ConnectorTagNames.REQUIRED_WORK_CONTEXT, className); } //license info LicenseNode licenseNode = new LicenseNode(); connectorNode = licenseNode.writeDescriptor(connectorNode, conDesc); // resource adapter node RANode raNode = new RANode(); connectorNode = raNode.writeDescriptor(connectorNode, conDesc); return connectorNode; }
/** * write the descriptor class to a DOM tree and return it * * @param parent node for the DOM tree * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor(Node parent, ConnectorDescriptor conDesc) { conDesc.setSpecVersion(VERSION_15); Node connectorNode = super.writeDescriptor(parent, conDesc); appendTextChild(connectorNode, ConnectorTagNames.VENDOR_NAME, conDesc.getVendorName()); appendTextChild(connectorNode, ConnectorTagNames.EIS_TYPE, conDesc.getEisType()); appendTextChild(connectorNode, ConnectorTagNames.RESOURCEADAPTER_VERSION, conDesc.getResourceAdapterVersion()); Iterator requiredInflowContexts = conDesc.getRequiredWorkContexts().iterator(); for (; requiredInflowContexts.hasNext();) { String className = (String) requiredInflowContexts.next(); appendTextChild(connectorNode, ConnectorTagNames.REQUIRED_WORK_CONTEXT, className); } //license info LicenseNode licenseNode = new LicenseNode(); connectorNode = licenseNode.writeDescriptor(connectorNode, conDesc); // resource adapter node RANode raNode = new RANode(); connectorNode = raNode.writeDescriptor(connectorNode, conDesc); return connectorNode; }