Java Code Examples for com.sun.xml.internal.xsom.XSSimpleType#isLocal()

The following examples show how to use com.sun.xml.internal.xsom.XSSimpleType#isLocal() . 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: SchemaWriter.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private void dump( XSAttributeDecl decl, String additionalAtts ) {
    XSSimpleType type=decl.getType();

    println(MessageFormat.format("<attribute name=\"{0}\"{1}{2}{3}{4}{5}>",
        decl.getName(),
        additionalAtts,
        type.isLocal()?"":
            MessageFormat.format(" type=\"'{'{0}'}'{1}\"", type.getTargetNamespace(), type.getName()),
        decl.getFixedValue()==null ?
            "":" fixed=\""+decl.getFixedValue()+'\"',
        decl.getDefaultValue()==null ?
            "":" default=\""+decl.getDefaultValue()+'\"',
        type.isLocal()?"":" /"));

    if(type.isLocal()) {
        indent++;
        simpleType(type);
        indent--;
        println("</attribute>");
    }
}
 
Example 2
Source File: SchemaTreeTraverser.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates node for attribute declaration with additional attributes.
 *
 * @param decl           Attribute declaration.
 * @param additionalAtts Additional attributes.
 */
private void dump(XSAttributeDecl decl, String additionalAtts) {
    XSSimpleType type = decl.getType();

    String str = MessageFormat.format("Attribute \"{0}\"{1}{2}{3}{4}",
            new Object[]{
                decl.getName(),
                additionalAtts,
                type.isLocal() ? "" : MessageFormat.format(
                        " type=\"'{'{0}'}'{1}\"", new Object[]{
                            type.getTargetNamespace(),
                            type.getName()}),
                decl.getFixedValue() == null ? "" : " fixed=\""
            + decl.getFixedValue() + "\"",
                decl.getDefaultValue() == null ? "" : " default=\""
            + decl.getDefaultValue() + "\""});

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

    if (type.isLocal()) {
        simpleType(type);
    }
    this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
 
Example 3
Source File: SchemaTreeTraverser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates node for attribute declaration with additional attributes.
 *
 * @param decl           Attribute declaration.
 * @param additionalAtts Additional attributes.
 */
private void dump(XSAttributeDecl decl, String additionalAtts) {
    XSSimpleType type = decl.getType();

    String str = MessageFormat.format("Attribute \"{0}\"{1}{2}{3}{4}",
            new Object[]{
                decl.getName(),
                additionalAtts,
                type.isLocal() ? "" : MessageFormat.format(
                        " type=\"'{'{0}'}'{1}\"", new Object[]{
                            type.getTargetNamespace(),
                            type.getName()}),
                decl.getFixedValue() == null ? "" : " fixed=\""
            + decl.getFixedValue() + "\"",
                decl.getDefaultValue() == null ? "" : " default=\""
            + decl.getDefaultValue() + "\""});

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

    if (type.isLocal()) {
        simpleType(type);
    }
    this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
 
Example 4
Source File: SchemaWriter.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void dump( XSAttributeDecl decl, String additionalAtts ) {
    XSSimpleType type=decl.getType();

    println(MessageFormat.format("<attribute name=\"{0}\"{1}{2}{3}{4}{5}>",
        decl.getName(),
        additionalAtts,
        type.isLocal()?"":
            MessageFormat.format(" type=\"'{'{0}'}'{1}\"", type.getTargetNamespace(), type.getName()),
        decl.getFixedValue()==null ?
            "":" fixed=\""+decl.getFixedValue()+'\"',
        decl.getDefaultValue()==null ?
            "":" default=\""+decl.getDefaultValue()+'\"',
        type.isLocal()?"":" /"));

    if(type.isLocal()) {
        indent++;
        simpleType(type);
        indent--;
        println("</attribute>");
    }
}
 
Example 5
Source File: SchemaTreeTraverser.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates node for attribute declaration with additional attributes.
 *
 * @param decl           Attribute declaration.
 * @param additionalAtts Additional attributes.
 */
private void dump(XSAttributeDecl decl, String additionalAtts) {
    XSSimpleType type = decl.getType();

    String str = MessageFormat.format("Attribute \"{0}\"{1}{2}{3}{4}",
            new Object[]{
                decl.getName(),
                additionalAtts,
                type.isLocal() ? "" : MessageFormat.format(
                        " type=\"'{'{0}'}'{1}\"", new Object[]{
                            type.getTargetNamespace(),
                            type.getName()}),
                decl.getFixedValue() == null ? "" : " fixed=\""
            + decl.getFixedValue() + "\"",
                decl.getDefaultValue() == null ? "" : " default=\""
            + decl.getDefaultValue() + "\""});

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

    if (type.isLocal()) {
        simpleType(type);
    }
    this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
 
Example 6
Source File: SchemaWriter.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private void dump( XSAttributeDecl decl, String additionalAtts ) {
    XSSimpleType type=decl.getType();

    println(MessageFormat.format("<attribute name=\"{0}\"{1}{2}{3}{4}{5}>",
        decl.getName(),
        additionalAtts,
        type.isLocal()?"":
            MessageFormat.format(" type=\"'{'{0}'}'{1}\"", type.getTargetNamespace(), type.getName()),
        decl.getFixedValue()==null ?
            "":" fixed=\""+decl.getFixedValue()+'\"',
        decl.getDefaultValue()==null ?
            "":" default=\""+decl.getDefaultValue()+'\"',
        type.isLocal()?"":" /"));

    if(type.isLocal()) {
        indent++;
        simpleType(type);
        indent--;
        println("</attribute>");
    }
}
 
Example 7
Source File: SchemaTreeTraverser.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates node for attribute declaration with additional attributes.
 *
 * @param decl           Attribute declaration.
 * @param additionalAtts Additional attributes.
 */
private void dump(XSAttributeDecl decl, String additionalAtts) {
    XSSimpleType type = decl.getType();

    String str = MessageFormat.format("Attribute \"{0}\"{1}{2}{3}{4}",
            new Object[]{
                decl.getName(),
                additionalAtts,
                type.isLocal() ? "" : MessageFormat.format(
                        " type=\"'{'{0}'}'{1}\"", new Object[]{
                            type.getTargetNamespace(),
                            type.getName()}),
                decl.getFixedValue() == null ? "" : " fixed=\""
            + decl.getFixedValue() + "\"",
                decl.getDefaultValue() == null ? "" : " default=\""
            + decl.getDefaultValue() + "\""});

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

    if (type.isLocal()) {
        simpleType(type);
    }
    this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
 
Example 8
Source File: SchemaWriter.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private void dump( XSAttributeDecl decl, String additionalAtts ) {
    XSSimpleType type=decl.getType();

    println(MessageFormat.format("<attribute name=\"{0}\"{1}{2}{3}{4}{5}>",
        decl.getName(),
        additionalAtts,
        type.isLocal()?"":
            MessageFormat.format(" type=\"'{'{0}'}'{1}\"", type.getTargetNamespace(), type.getName()),
        decl.getFixedValue()==null ?
            "":" fixed=\""+decl.getFixedValue()+'\"',
        decl.getDefaultValue()==null ?
            "":" default=\""+decl.getDefaultValue()+'\"',
        type.isLocal()?"":" /"));

    if(type.isLocal()) {
        indent++;
        simpleType(type);
        indent--;
        println("</attribute>");
    }
}
 
Example 9
Source File: SchemaTreeTraverser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void restrictionSimpleType(XSRestrictionSimpleType type) {

        if (type.getBaseType() == null) {
            // don't print anySimpleType
            if (!type.getName().equals("anySimpleType")) {
                throw new InternalError();
            }
            if (!Const.schemaNamespace.equals(type.getTargetNamespace())) {
                throw new InternalError();
            }
            return;
        }

        XSSimpleType baseType = type.getSimpleBaseType();

        String str = MessageFormat.format("Restriction {0}",
                new Object[]{baseType.isLocal() ? "" : " base=\"{"
                + baseType.getTargetNamespace() + "}"
                + baseType.getName() + "\""});

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

        if (baseType.isLocal()) {
            simpleType(baseType);
        }

        Iterator itr = type.iterateDeclaredFacets();
        while (itr.hasNext()) {
            facet((XSFacet) itr.next());
        }

        this.currNode = (SchemaTreeNode) this.currNode.getParent();
    }
 
Example 10
Source File: SchemaWriter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void listSimpleType( XSListSimpleType type ) {
    XSSimpleType itemType = type.getItemType();

    if(itemType.isLocal()) {
        println("<list>");
        indent++;
        simpleType(itemType);
        indent--;
        println("</list>");
    } else {
        // global type
        println(MessageFormat.format("<list itemType=\"'{'{0}'}'{1}\" />",
            itemType.getTargetNamespace(), itemType.getName()));
    }
}
 
Example 11
Source File: SchemaWriter.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void listSimpleType( XSListSimpleType type ) {
    XSSimpleType itemType = type.getItemType();

    if(itemType.isLocal()) {
        println("<list>");
        indent++;
        simpleType(itemType);
        indent--;
        println("</list>");
    } else {
        // global type
        println(MessageFormat.format("<list itemType=\"'{'{0}'}'{1}\" />",
            itemType.getTargetNamespace(), itemType.getName()));
    }
}
 
Example 12
Source File: SchemaWriter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void restrictionSimpleType( XSRestrictionSimpleType type ) {

        if(type.getBaseType()==null) {
            // don't print anySimpleType
            if(!type.getName().equals("anySimpleType"))
                throw new InternalError();
            if(!Const.schemaNamespace.equals(type.getTargetNamespace()))
                throw new InternalError();
            return;
        }

        XSSimpleType baseType = type.getSimpleBaseType();

        println(MessageFormat.format("<restriction{0}>",
            baseType.isLocal()?"":" base=\"{"+
            baseType.getTargetNamespace()+'}'+
            baseType.getName()+'\"'));
        indent++;

        if(baseType.isLocal())
            simpleType(baseType);

        Iterator itr = type.iterateDeclaredFacets();
        while(itr.hasNext())
            facet( (XSFacet)itr.next() );

        indent--;
        println("</restriction>");
    }
 
Example 13
Source File: SchemaWriter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void restrictionSimpleType( XSRestrictionSimpleType type ) {

        if(type.getBaseType()==null) {
            // don't print anySimpleType
            if(!type.getName().equals("anySimpleType"))
                throw new InternalError();
            if(!Const.schemaNamespace.equals(type.getTargetNamespace()))
                throw new InternalError();
            return;
        }

        XSSimpleType baseType = type.getSimpleBaseType();

        println(MessageFormat.format("<restriction{0}>",
            baseType.isLocal()?"":" base=\"{"+
            baseType.getTargetNamespace()+'}'+
            baseType.getName()+'\"'));
        indent++;

        if(baseType.isLocal())
            simpleType(baseType);

        Iterator itr = type.iterateDeclaredFacets();
        while(itr.hasNext())
            facet( (XSFacet)itr.next() );

        indent--;
        println("</restriction>");
    }
 
Example 14
Source File: SchemaWriter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void listSimpleType( XSListSimpleType type ) {
    XSSimpleType itemType = type.getItemType();

    if(itemType.isLocal()) {
        println("<list>");
        indent++;
        simpleType(itemType);
        indent--;
        println("</list>");
    } else {
        // global type
        println(MessageFormat.format("<list itemType=\"'{'{0}'}'{1}\" />",
            itemType.getTargetNamespace(), itemType.getName()));
    }
}
 
Example 15
Source File: SchemaTreeTraverser.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void restrictionSimpleType(XSRestrictionSimpleType type) {

        if (type.getBaseType() == null) {
            // don't print anySimpleType
            if (!type.getName().equals("anySimpleType")) {
                throw new InternalError();
            }
            if (!Const.schemaNamespace.equals(type.getTargetNamespace())) {
                throw new InternalError();
            }
            return;
        }

        XSSimpleType baseType = type.getSimpleBaseType();

        String str = MessageFormat.format("Restriction {0}",
                new Object[]{baseType.isLocal() ? "" : " base=\"{"
                + baseType.getTargetNamespace() + "}"
                + baseType.getName() + "\""});

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

        if (baseType.isLocal()) {
            simpleType(baseType);
        }

        Iterator itr = type.iterateDeclaredFacets();
        while (itr.hasNext()) {
            facet((XSFacet) itr.next());
        }

        this.currNode = (SchemaTreeNode) this.currNode.getParent();
    }
 
Example 16
Source File: SchemaWriter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void restrictionSimpleType( XSRestrictionSimpleType type ) {

        if(type.getBaseType()==null) {
            // don't print anySimpleType
            if(!type.getName().equals("anySimpleType"))
                throw new InternalError();
            if(!Const.schemaNamespace.equals(type.getTargetNamespace()))
                throw new InternalError();
            return;
        }

        XSSimpleType baseType = type.getSimpleBaseType();

        println(MessageFormat.format("<restriction{0}>",
            baseType.isLocal()?"":" base=\"{"+
            baseType.getTargetNamespace()+'}'+
            baseType.getName()+'\"'));
        indent++;

        if(baseType.isLocal())
            simpleType(baseType);

        Iterator itr = type.iterateDeclaredFacets();
        while(itr.hasNext())
            facet( (XSFacet)itr.next() );

        indent--;
        println("</restriction>");
    }
 
Example 17
Source File: SchemaTreeTraverser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void restrictionSimpleType(XSRestrictionSimpleType type) {

        if (type.getBaseType() == null) {
            // don't print anySimpleType
            if (!type.getName().equals("anySimpleType")) {
                throw new InternalError();
            }
            if (!Const.schemaNamespace.equals(type.getTargetNamespace())) {
                throw new InternalError();
            }
            return;
        }

        XSSimpleType baseType = type.getSimpleBaseType();

        String str = MessageFormat.format("Restriction {0}",
                new Object[]{baseType.isLocal() ? "" : " base=\"{"
                + baseType.getTargetNamespace() + "}"
                + baseType.getName() + "\""});

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

        if (baseType.isLocal()) {
            simpleType(baseType);
        }

        Iterator itr = type.iterateDeclaredFacets();
        while (itr.hasNext()) {
            facet((XSFacet) itr.next());
        }

        this.currNode = (SchemaTreeNode) this.currNode.getParent();
    }
 
Example 18
Source File: SchemaTreeTraverser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void restrictionSimpleType(XSRestrictionSimpleType type) {

        if (type.getBaseType() == null) {
            // don't print anySimpleType
            if (!type.getName().equals("anySimpleType")) {
                throw new InternalError();
            }
            if (!Const.schemaNamespace.equals(type.getTargetNamespace())) {
                throw new InternalError();
            }
            return;
        }

        XSSimpleType baseType = type.getSimpleBaseType();

        String str = MessageFormat.format("Restriction {0}",
                new Object[]{baseType.isLocal() ? "" : " base=\"{"
                + baseType.getTargetNamespace() + "}"
                + baseType.getName() + "\""});

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

        if (baseType.isLocal()) {
            simpleType(baseType);
        }

        Iterator itr = type.iterateDeclaredFacets();
        while (itr.hasNext()) {
            facet((XSFacet) itr.next());
        }

        this.currNode = (SchemaTreeNode) this.currNode.getParent();
    }
 
Example 19
Source File: SchemaTreeTraverser.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void restrictionSimpleType(XSRestrictionSimpleType type) {

        if (type.getBaseType() == null) {
            // don't print anySimpleType
            if (!type.getName().equals("anySimpleType")) {
                throw new InternalError();
            }
            if (!Const.schemaNamespace.equals(type.getTargetNamespace())) {
                throw new InternalError();
            }
            return;
        }

        XSSimpleType baseType = type.getSimpleBaseType();

        String str = MessageFormat.format("Restriction {0}",
                new Object[]{baseType.isLocal() ? "" : " base=\"{"
                + baseType.getTargetNamespace() + "}"
                + baseType.getName() + "\""});

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

        if (baseType.isLocal()) {
            simpleType(baseType);
        }

        Iterator itr = type.iterateDeclaredFacets();
        while (itr.hasNext()) {
            facet((XSFacet) itr.next());
        }

        this.currNode = (SchemaTreeNode) this.currNode.getParent();
    }
 
Example 20
Source File: SchemaTreeTraverser.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void restrictionSimpleType(XSRestrictionSimpleType type) {

        if (type.getBaseType() == null) {
            // don't print anySimpleType
            if (!type.getName().equals("anySimpleType")) {
                throw new InternalError();
            }
            if (!Const.schemaNamespace.equals(type.getTargetNamespace())) {
                throw new InternalError();
            }
            return;
        }

        XSSimpleType baseType = type.getSimpleBaseType();

        String str = MessageFormat.format("Restriction {0}",
                new Object[]{baseType.isLocal() ? "" : " base=\"{"
                + baseType.getTargetNamespace() + "}"
                + baseType.getName() + "\""});

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

        if (baseType.isLocal()) {
            simpleType(baseType);
        }

        Iterator itr = type.iterateDeclaredFacets();
        while (itr.hasNext()) {
            facet((XSFacet) itr.next());
        }

        this.currNode = (SchemaTreeNode) this.currNode.getParent();
    }