Java Code Examples for com.sun.xml.internal.xsom.XSElementDecl#getLocator()

The following examples show how to use com.sun.xml.internal.xsom.XSElementDecl#getLocator() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SchemaTreeTraverser.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates node for element declaration with additional attributes.
 *
 * @param decl      Element declaration.
 * @param extraAtts Additional attributes.
 */
private void elementDecl(XSElementDecl decl, String extraAtts) {
    XSType type = decl.getType();

    // TODO: various other attributes

    String str = MessageFormat.format("Element name=\"{0}\"{1}{2}",
            new Object[]{
                decl.getName(),
                type.isLocal() ? "" : " type=\"{"
            + type.getTargetNamespace() + "}"
            + type.getName() + "\"", extraAtts});

    SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator());
    this.currNode.add(newNode);
    this.currNode = newNode;

    if (type.isLocal()) {
        if (type.isLocal()) {
            type.visit(this);
        }
    }

    this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
 
Example 2
Source File: SchemaTreeTraverser.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates node for element declaration with additional attributes.
 *
 * @param decl      Element declaration.
 * @param extraAtts Additional attributes.
 */
private void elementDecl(XSElementDecl decl, String extraAtts) {
    XSType type = decl.getType();

    // TODO: various other attributes

    String str = MessageFormat.format("Element name=\"{0}\"{1}{2}",
            new Object[]{
                decl.getName(),
                type.isLocal() ? "" : " type=\"{"
            + type.getTargetNamespace() + "}"
            + type.getName() + "\"", extraAtts});

    SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator());
    this.currNode.add(newNode);
    this.currNode = newNode;

    if (type.isLocal()) {
        if (type.isLocal()) {
            type.visit(this);
        }
    }

    this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
 
Example 3
Source File: SchemaTreeTraverser.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates node for element declaration with additional attributes.
 *
 * @param decl      Element declaration.
 * @param extraAtts Additional attributes.
 */
private void elementDecl(XSElementDecl decl, String extraAtts) {
    XSType type = decl.getType();

    // TODO: various other attributes

    String str = MessageFormat.format("Element name=\"{0}\"{1}{2}",
            new Object[]{
                decl.getName(),
                type.isLocal() ? "" : " type=\"{"
            + type.getTargetNamespace() + "}"
            + type.getName() + "\"", extraAtts});

    SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator());
    this.currNode.add(newNode);
    this.currNode = newNode;

    if (type.isLocal()) {
        if (type.isLocal()) {
            type.visit(this);
        }
    }

    this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
 
Example 4
Source File: SchemaTreeTraverser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates node for element declaration with additional attributes.
 *
 * @param decl      Element declaration.
 * @param extraAtts Additional attributes.
 */
private void elementDecl(XSElementDecl decl, String extraAtts) {
    XSType type = decl.getType();

    // TODO: various other attributes

    String str = MessageFormat.format("Element name=\"{0}\"{1}{2}",
            new Object[]{
                decl.getName(),
                type.isLocal() ? "" : " type=\"{"
            + type.getTargetNamespace() + "}"
            + type.getName() + "\"", extraAtts});

    SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator());
    this.currNode.add(newNode);
    this.currNode = newNode;

    if (type.isLocal()) {
        if (type.isLocal()) {
            type.visit(this);
        }
    }

    this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
 
Example 5
Source File: SchemaTreeTraverser.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates node for element declaration with additional attributes.
 *
 * @param decl      Element declaration.
 * @param extraAtts Additional attributes.
 */
private void elementDecl(XSElementDecl decl, String extraAtts) {
    XSType type = decl.getType();

    // TODO: various other attributes

    String str = MessageFormat.format("Element name=\"{0}\"{1}{2}",
            new Object[]{
                decl.getName(),
                type.isLocal() ? "" : " type=\"{"
            + type.getTargetNamespace() + "}"
            + type.getName() + "\"", extraAtts});

    SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator());
    this.currNode.add(newNode);
    this.currNode = newNode;

    if (type.isLocal()) {
        if (type.isLocal()) {
            type.visit(this);
        }
    }

    this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
 
Example 6
Source File: SchemaTreeTraverser.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates node for element declaration with additional attributes.
 *
 * @param decl      Element declaration.
 * @param extraAtts Additional attributes.
 */
private void elementDecl(XSElementDecl decl, String extraAtts) {
    XSType type = decl.getType();

    // TODO: various other attributes

    String str = MessageFormat.format("Element name=\"{0}\"{1}{2}",
            new Object[]{
                decl.getName(),
                type.isLocal() ? "" : " type=\"{"
            + type.getTargetNamespace() + "}"
            + type.getName() + "\"", extraAtts});

    SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator());
    this.currNode.add(newNode);
    this.currNode = newNode;

    if (type.isLocal()) {
        if (type.isLocal()) {
            type.visit(this);
        }
    }

    this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
 
Example 7
Source File: SchemaTreeTraverser.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates node for element declaration with additional attributes.
 *
 * @param decl      Element declaration.
 * @param extraAtts Additional attributes.
 */
private void elementDecl(XSElementDecl decl, String extraAtts) {
    XSType type = decl.getType();

    // TODO: various other attributes

    String str = MessageFormat.format("Element name=\"{0}\"{1}{2}",
            new Object[]{
                decl.getName(),
                type.isLocal() ? "" : " type=\"{"
            + type.getTargetNamespace() + "}"
            + type.getName() + "\"", extraAtts});

    SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator());
    this.currNode.add(newNode);
    this.currNode = newNode;

    if (type.isLocal()) {
        if (type.isLocal()) {
            type.visit(this);
        }
    }

    this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
 
Example 8
Source File: SchemaTreeTraverser.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates node for element declaration with additional attributes.
 *
 * @param decl      Element declaration.
 * @param extraAtts Additional attributes.
 */
private void elementDecl(XSElementDecl decl, String extraAtts) {
    XSType type = decl.getType();

    // TODO: various other attributes

    String str = MessageFormat.format("Element name=\"{0}\"{1}{2}",
            new Object[]{
                decl.getName(),
                type.isLocal() ? "" : " type=\"{"
            + type.getTargetNamespace() + "}"
            + type.getName() + "\"", extraAtts});

    SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator());
    this.currNode.add(newNode);
    this.currNode = newNode;

    if (type.isLocal()) {
        if (type.isLocal()) {
            type.visit(this);
        }
    }

    this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
 
Example 9
Source File: DefaultClassBinder.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
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);
    }

    return r;
}
 
Example 10
Source File: DefaultClassBinder.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
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);
    }

    return r;
}
 
Example 11
Source File: DefaultClassBinder.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
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);
    }

    return r;
}
 
Example 12
Source File: DefaultClassBinder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
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);
    }

    return r;
}
 
Example 13
Source File: DefaultClassBinder.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
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);
    }

    return r;
}
 
Example 14
Source File: DefaultClassBinder.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
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);
    }

    return r;
}
 
Example 15
Source File: DefaultClassBinder.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
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);
    }

    return r;
}
 
Example 16
Source File: DefaultClassBinder.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
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);
    }

    return r;
}