Package org.w3c.dom

Examples of org.w3c.dom.Element


   * @throws Exception if the DOM creation fails
   */
  public Element writeMetaBean(Element parent, Object o, String name)
      throws Exception {
   
    Element         node;
    MetaBean        meta;

    // for debugging only
    if (DEBUG)
       trace(new Throwable(), name);
View Full Code Here


   * @throws Exception if instantiation fails
   */
  public Object readMetaBean(Element node) throws Exception {
    Object          result;
    Vector          children;
    Element         child;
    int             i;
    String          name;
    Vector          inputs;
    Vector          outputs;
    Vector          coords;
    MetaBean        bean;

    // for debugging only
    if (DEBUG)
       trace(new Throwable(), node.getAttribute(ATT_NAME));

    m_CurrentNode = node;
   
    result   = new MetaBean();
    children = XMLDocument.getChildTags(node);
    inputs   = new Vector();
    outputs  = new Vector();
    coords   = new Vector();
   
    // the current MetaBean
    m_CurrentMetaBean = (MetaBean) result;

    for (i = 0; i < children.size(); i++) {
      child = (Element) children.get(i);
      name  = child.getAttribute(ATT_NAME);

      if (name.equals(VAL_ASSOCIATEDCONNECTIONS))
        ((MetaBean) result).setAssociatedConnections((Vector) invokeReadFromXML(child));
      else if (name.equals(VAL_INPUTSID))
        inputs = (Vector) invokeReadFromXML(child);
View Full Code Here

        return coords;
    }

    @Override
    public Element getSVGString(SVGDocument doc) {
        Element group = null;
        group = doc.createElementNS("http://www.w3.org/2000/svg", "g");
        group.setAttributeNS(null, "id", getLayerId());
        if (isAddOpacity()) {
            group.setAttributeNS(null, "style", "opacity:" + getOpacity());
        }

        group.appendChild(getBoxDefinition(doc));
        group.appendChild(getImageDefinition(doc));
        if (!isSimpleLayout()) {
            group.appendChild(getEventHandlerIcon(doc));
            group.appendChild(getCompensationHandlerIcon(doc));
            group.appendChild(getFaultHandlerIcon(doc));
            group.appendChild(getTerminationHandlerIcon(doc));
        }
        // Get Sub Activities
        group.appendChild(getSubActivitiesSVGString(doc));
        group.appendChild(getEndImageDefinition(doc));
        //Add Arrow
        group.appendChild(getArrows(doc));
        //attention - here group1 contain the box definition+ImageDefinition+etc... in the original
        // but here group does not contain that
        return group;
    }
View Full Code Here

            // read the schema to DOM representation
            DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
            fact.setNamespaceAware(true);
            DocumentBuilder bldr = fact.newDocumentBuilder();
            doc = bldr.parse(m_wsdlProvider.getWSDL(req));
            Element schema = doc.getDocumentElement();
            NodeList services = schema.getElementsByTagNameNS(WSDLSOAP_NAMESPACE, "address");
            for (int i = 0; i < services.getLength(); i++) {
                Node node = services.item(i).getAttributes().getNamedItem("location");
                if (node != null) {
                    String location = node.getTextContent();
                    node.setTextContent(adaptLocation(location, locationBase));
View Full Code Here

    }   
   
    public Object end(final String uri,
                      final String localName,
                      final ExtensibleXmlParser parser) throws SAXException {
        final Element element = parser.endElementBuilder();       
        return parser.getCurrent();
    }
View Full Code Here

    return connection;
  }

  public Object end(final String uri, final String localName,
      final ExtensibleXmlParser parser) throws SAXException {
    final Element element = parser.endElementBuilder();
    return parser.getCurrent();
  }
View Full Code Here

    }   
   
    public Object end(final String uri,
                      final String localName,
                      final ExtensibleXmlParser parser) throws SAXException {
        final Element element = parser.endElementBuilder();
        ValueObject valueObject = (ValueObject) parser.getParent();
        String text = ((Text)element.getChildNodes().item( 0 )).getWholeText();
        if (text != null) {
            text.trim();
            if ("".equals(text)) {
                text = null;
            }
View Full Code Here

    return null;
  }

  public Object end(final String uri, final String localName,
      final ExtensibleXmlParser parser) throws SAXException {
    final Element element = parser.endElementBuilder();
    ContextContainer contextContainer = (ContextContainer) parser.getParent();

    final String type = element.getAttribute("type");
    emptyAttributeCheck(localName, "type", type, parser);

    final String faultName = element.getAttribute("faultName");
    emptyAttributeCheck(localName, "faultName", type, parser);
   
    final String faultVariable = element.getAttribute("faultVariable");
   
    ExceptionHandler exceptionHandler = null;
    if ("action".equals(type)) {
      exceptionHandler = new ActionExceptionHandler();
      org.w3c.dom.Node xmlNode = element.getFirstChild();
          if (xmlNode instanceof Element) {
          Element actionXml = (Element) xmlNode;
          DroolsAction action = ActionNodeHandler.extractAction(actionXml);
          ((ActionExceptionHandler) exceptionHandler).setAction(action);
          }
    } else {
      throw new SAXParseException("Unknown exception handler type " + type, parser.getLocator());
View Full Code Here

    }   
   
    public Object end(final String uri,
                      final String localName,
                      final ExtensibleXmlParser parser) throws SAXException {
        Element element = parser.endElementBuilder();
        StateBasedNode parent = (StateBasedNode) parser.getParent();
        String id = element.getAttribute("id");
        emptyAttributeCheck( localName, "id", id, parser );
        String delay = element.getAttribute("delay");
        String period = element.getAttribute("period");
        Timer timer = new Timer();
        timer.setId(new Long(id));
        if (delay != null && delay.length() != 0 ) {
            timer.setDelay(delay);
        }
        if (period != null && period.length() != 0 ) {
            timer.setPeriod(period);
        }
        org.w3c.dom.Node xmlNode = element.getFirstChild();
        DroolsAction action = null;
        if (xmlNode instanceof Element) {
        Element actionXml = (Element) xmlNode;
        action = AbstractNodeHandler.extractAction(actionXml);
        }
        parent.addTimer(timer, action);
        return null;
    }
View Full Code Here

    protected abstract Node createNode();

    public Object end(final String uri, final String localName,
                      final ExtensibleXmlParser parser) throws SAXException {
        final Element element = parser.endElementBuilder();
        Node node = (Node) parser.getCurrent();
        handleNode(node, element, uri, localName, parser);
        return node;
    }
View Full Code Here

TOP

Related Classes of org.w3c.dom.Element

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.