Examples of CElement


Examples of com.sun.tools.xjc.model.CElement

        return sole;
    }

    public CElement elementDecl(XSElementDecl decl) {
        CElement r = allow(decl,decl.getName());

        if(r==null) {
            QName tagName = getName(decl);
            CCustomizations custs = builder.getBindInfo(decl).toCustomizationList();

            if(decl.isGlobal()) {
                if(isCollapsable(decl)) {
                    // we want the returned type to be built as a complex type,
                    // so the binding cannot be delayed.
                    return selector.bindToType(decl.getType().asComplexType(),decl,true);
                } else {
                    String className = null;
                    if(getGlobalBinding().isGenerateElementClass())
                        className = deriveName(decl);

                    // otherwise map global elements to JAXBElement
                    CElementInfo cei = new CElementInfo(
                        model, tagName, selector.getClassScope(), className, custs, decl.getLocator());
                    selector.boundElements.put(decl,cei);

                    stb.refererStack.push(decl);    // referer is element
                    cei.initContentType( selector.bindToType(decl.getType(),decl), decl, decl.getDefaultValue() );
                    stb.refererStack.pop();
                    r = cei;
                }
            }
        }

        // have the substitution member derive from the substitution head
        XSElementDecl top = decl.getSubstAffiliation();
        if(top!=null) {
            CElement topci = selector.bindToType(top,decl);

            if(r instanceof CClassInfo && topci instanceof CClassInfo)
                ((CClassInfo)r).setBaseClass((CClassInfo)topci);
            if (r instanceof CElementInfo && topci instanceof CElementInfo)
                ((CElementInfo)r).setSubstitutionHead((CElementInfo)topci);
View Full Code Here

Examples of com.sun.tools.xjc.model.CElement

    public CClassInfo attributeUse(XSAttributeUse use) {
        return never();
    }

    public CElement simpleType(XSSimpleType type) {
        CElement c = allow(type,type.getName());
        if(c!=null) return c;

        if(getGlobalBinding().isSimpleTypeSubstitution() && type.isGlobal()) {
            return new CClassInfo(model,selector.getClassScope(),
                    deriveName(type), type.getLocator(), getName(type), null, type, null );
View Full Code Here

Examples of org.allcolor.xml.parser.dom.CElement

    inXInclude--;
      } // end if
  } // end if

  CElement elem = null;
  if (parser.htmlDocument) {
      elem = document.createElementInternal(name, indexSep);
      if (currentElement != document && elem instanceof IHtmlValidChild) {
    while (!isValidChild(name, currentElement)) {
        parseEndTag(currentElement.name, -1);
        if (currentElement == document)
      break;
    }
      }
  } else {
      elem = new CElement(name, document, indexSep);
  }

  if (firstTag) {
      if (parser.htmlDocument) {
    document.setHTMLDocument(true);
      } // end if
      firstTag = false;
      document.loadXSD(elem);
      if (isAutodoctype() && document.getDoctype() == null) {
    CDocType dt = (CDocType) CXmlParser.dtTr.cloneNode(true);
    document.appendChildInternal(dt);
    document.setDocumentType(dt);
      }
  } // end if

  if (count > 0) {
      if (elem.listAttributes == null) {
    elem.listAttributes = new CNamedNodeMap(elem);
    elem.listAttributes.list = attributes;
    elem.listAttributes.count = count;
    for (int i = 0; i < count; i++) {
        CAttr attr = attributes[i];
        attr.parentNode = elem;
        attr.ownerDocument = document;
        if (attr.name == "xmlns" || attr.prefix == "xmlns") {
      elem.notifyNSChange(attr.localName);
        }
    }
      } else {
    for (int i = 0; i < count; i++) {
        CAttr attr = attributes[i];
        attr.parentNode = elem;
        attr.ownerDocument = document;
        if (attr.name == "xmlns" || attr.prefix == "xmlns") {
      elem.notifyNSChange(attr.localName);
        }
        if (elem.listAttributes == null) {
      elem.listAttributes = new CNamedNodeMap(elem);
        }
        elem.listAttributes.setNamedItemForce(attr);
    } // end for
      }
  }

  if (currentElement == document) {
      document.appendChildInternal(elem);
  } else {
      elem.parentNode = currentElement;
      currentElement.listChild.addItem(elem);
  }

  if (XIncludeAware
    && "http://www.w3.org/2001/XInclude".equals(elem
      .getNamespaceURI())) {
      handleXInclude(elem);

      if (inXInclude > 0) {
    if (name.endsWith("include")) {
View Full Code Here

Examples of org.allcolor.xml.parser.dom.CElement

                );
            elem.setNameOverride(type);
            return elem;
        } else {
          if (indexSep == -1) {
              return new CElement(
                      type,
                      ownerDocument
                  );
          } else {
              return new CElement(
                      type,
                      ownerDocument,
                      indexSep
                  );
          }
View Full Code Here

Examples of org.allcolor.xml.parser.dom.CElement

    inXInclude--;
      } // end if
  } // end if

  CElement elem = null;
  if (parser.htmlDocument) {
      elem = document.createElementInternal(name, indexSep);
      if (currentElement != document && elem instanceof IHtmlValidChild) {
    while (!isValidChild(name, currentElement)) {
        parseEndTag(currentElement.name, -1);
        if (currentElement == document)
      break;
    }
      }
  } else {
      elem = new CElement(name, document, indexSep);
  }
  elem.listChild = new CNodeList(false);

  if (firstTag) {
      if (parser.htmlDocument) {
    document.setHTMLDocument(true);
      } // end if
      firstTag = false;
      document.loadXSD(elem);
      if (isAutodoctype() && document.getDoctype() == null) {
    CDocType dt = (CDocType) CXmlParser.dtTr.cloneNode(true);
    document.appendChildInternal(dt);
    document.setDocumentType(dt);
      }
  } // end if

  if (count > 0) {
      if (elem.listAttributes == null) {
    elem.listAttributes = new CNamedNodeMap(elem);
    elem.listAttributes.list = attributes;
    elem.listAttributes.count = count;
    for (int i = 0; i < count; i++) {
        CAttr attr = attributes[i];
        attr.parentNode = elem;
        attr.ownerDocument = document;
        if (attr.name == "xmlns" || attr.prefix == "xmlns") {
      elem.notifyNSChange(attr.localName);
        }
    }
      } else {
    for (int i = 0; i < count; i++) {
        CAttr attr = attributes[i];
        attr.parentNode = elem;
        attr.ownerDocument = document;
        if (attr.name == "xmlns" || attr.prefix == "xmlns") {
      elem.notifyNSChange(attr.localName);
        }
        if (elem.listAttributes == null) {
      elem.listAttributes = new CNamedNodeMap(elem);
        }
        elem.listAttributes.setNamedItemForce(attr);
    } // end for
      }
  }

  if (currentElement == document) {
      document.appendChildInternal(elem);
  } else {
      elem.parentNode = currentElement;
      currentElement.listChild.addItem(elem);
  }

  if (XIncludeAware
    && "http://www.w3.org/2001/XInclude".equals(elem
      .getNamespaceURI())) {
      handleXInclude(elem);
  } // end if
  else {
      if (parser.htmlDocument && elem instanceof IHtmlValidChild) {
View Full Code Here

Examples of org.allcolor.xml.parser.dom.CElement

         *                 DOCUMENT ME!
         */
  public void startElement(final String uri, final String localName,
    final String qName, final Attributes atts) throws SAXException {
      if (currentElement.getNodeType() != Node.ENTITY_REFERENCE_NODE) {
    CElement elem = new CElement(qName, document);

    for (int i = 0; i < atts.getLength(); i++) {
        CAttr attr = new CAttr(atts.getQName(i), atts.getValue(i),
          document, currentElement, true);
        if (currentElement.listAttributes == null) {
View Full Code Here

Examples of org.allcolor.xml.parser.dom.CElement

                );
            elem.setNameOverride(type);
            return elem;
        } else {
          if (indexSep == -1) {
              return new CElement(
                      type,
                      ownerDocument
                  );
          } else {
              return new CElement(
                      type,
                      ownerDocument,
                      indexSep
                  );
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.