com.sun.xml.internal.xsom.XSAttGroupDecl Java Examples

The following examples show how to use com.sun.xml.internal.xsom.XSAttGroupDecl. 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 openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void attGroupDecl(XSAttGroupDecl decl) {
    SchemaTreeNode newNode = new SchemaTreeNode("Attribute group \""
            + decl.getName() + "\"", decl.getLocator());
    this.currNode.add(newNode);
    this.currNode = newNode;

    Iterator itr;

    itr = decl.iterateAttGroups();
    while (itr.hasNext()) {
        dumpRef((XSAttGroupDecl) itr.next());
    }

    itr = decl.iterateDeclaredAttributeUses();
    while (itr.hasNext()) {
        attributeUse((XSAttributeUse) itr.next());
    }

    this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
 
Example #2
Source File: ComplexTypeImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public XSAttributeUse getAttributeUse( String nsURI, String localName ) {
    UName name = new UName(nsURI,localName);

    if(prohibitedAtts.contains(name))       return null;

    XSAttributeUse o = attributes.get(name);


    if(o==null) {
        Iterator itr = iterateAttGroups();
        while(itr.hasNext() && o==null)
            o = ((XSAttGroupDecl)itr.next()).getAttributeUse(nsURI,localName);
    }

    if(o==null) {
        XSType base = getBaseType();
        if(base.asComplexType()!=null)
            o = base.asComplexType().getAttributeUse(nsURI,localName);
    }

    return o;
}
 
Example #3
Source File: SchemaWriter.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void attGroupDecl( XSAttGroupDecl decl ) {
    Iterator itr;

    println(MessageFormat.format("<attGroup name=\"{0}\">", decl.getName()));
    indent++;

    // TODO: wildcard

    itr = decl.iterateAttGroups();
    while(itr.hasNext())
        dumpRef( (XSAttGroupDecl)itr.next() );

    itr = decl.iterateDeclaredAttributeUses();
    while(itr.hasNext())
        attributeUse( (XSAttributeUse)itr.next() );

    indent--;
    println("</attGroup>");
}
 
Example #4
Source File: SchemaWriter.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void attGroupDecl( XSAttGroupDecl decl ) {
    Iterator itr;

    println(MessageFormat.format("<attGroup name=\"{0}\">", decl.getName()));
    indent++;

    // TODO: wildcard

    itr = decl.iterateAttGroups();
    while(itr.hasNext())
        dumpRef( (XSAttGroupDecl)itr.next() );

    itr = decl.iterateDeclaredAttributeUses();
    while(itr.hasNext())
        attributeUse( (XSAttributeUse)itr.next() );

    indent--;
    println("</attGroup>");
}
 
Example #5
Source File: ComplexTypeImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public XSAttributeUse getAttributeUse( String nsURI, String localName ) {
    UName name = new UName(nsURI,localName);

    if(prohibitedAtts.contains(name))       return null;

    XSAttributeUse o = attributes.get(name);


    if(o==null) {
        Iterator itr = iterateAttGroups();
        while(itr.hasNext() && o==null)
            o = ((XSAttGroupDecl)itr.next()).getAttributeUse(nsURI,localName);
    }

    if(o==null) {
        XSType base = getBaseType();
        if(base.asComplexType()!=null)
            o = base.asComplexType().getAttributeUse(nsURI,localName);
    }

    return o;
}
 
Example #6
Source File: SchemaTreeTraverser.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void attGroupDecl(XSAttGroupDecl decl) {
    SchemaTreeNode newNode = new SchemaTreeNode("Attribute group \""
            + decl.getName() + "\"", decl.getLocator());
    this.currNode.add(newNode);
    this.currNode = newNode;

    Iterator itr;

    itr = decl.iterateAttGroups();
    while (itr.hasNext()) {
        dumpRef((XSAttGroupDecl) itr.next());
    }

    itr = decl.iterateDeclaredAttributeUses();
    while (itr.hasNext()) {
        attributeUse((XSAttributeUse) itr.next());
    }

    this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
 
Example #7
Source File: ComplexTypeImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public XSAttributeUse getAttributeUse( String nsURI, String localName ) {
    UName name = new UName(nsURI,localName);

    if(prohibitedAtts.contains(name))       return null;

    XSAttributeUse o = attributes.get(name);


    if(o==null) {
        Iterator itr = iterateAttGroups();
        while(itr.hasNext() && o==null)
            o = ((XSAttGroupDecl)itr.next()).getAttributeUse(nsURI,localName);
    }

    if(o==null) {
        XSType base = getBaseType();
        if(base.asComplexType()!=null)
            o = base.asComplexType().getAttributeUse(nsURI,localName);
    }

    return o;
}
 
Example #8
Source File: BindGreen.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void attContainer(XSAttContainer cont) {
    // inline
    Iterator itr = cont.iterateDeclaredAttributeUses();
    while(itr.hasNext())
        builder.ying((XSAttributeUse)itr.next(),cont);
    itr = cont.iterateAttGroups();
    while(itr.hasNext())
        builder.ying((XSAttGroupDecl)itr.next(),cont);

    XSWildcard w = cont.getAttributeWildcard();
    if(w!=null)
        builder.ying(w,cont);
}
 
Example #9
Source File: SchemaSetImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Iterator<XSAttGroupDecl> iterateAttGroupDecls() {
    return new Iterators.Map<XSAttGroupDecl,XSSchema>(iterateSchema()) {
        protected Iterator<XSAttGroupDecl> apply(XSSchema u) {
            return u.iterateAttGroupDecls();
        }
    };
}
 
Example #10
Source File: AttributesHolder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the attribute uses by looking at attribute groups and etc.
 * Searching for the base type is done in {@link ComplexTypeImpl}.
 */
public Collection<XSAttributeUse> getAttributeUses() {
    // TODO: this is fairly inefficient
    List<XSAttributeUse> v = new ArrayList<XSAttributeUse>();
    v.addAll(attributes.values());
    for( XSAttGroupDecl agd : getAttGroups() )
        v.addAll(agd.getAttributeUses());
    return v;
}
 
Example #11
Source File: AttributesHolder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the attribute uses by looking at attribute groups and etc.
 * Searching for the base type is done in {@link ComplexTypeImpl}.
 */
public Collection<XSAttributeUse> getAttributeUses() {
    // TODO: this is fairly inefficient
    List<XSAttributeUse> v = new ArrayList<XSAttributeUse>();
    v.addAll(attributes.values());
    for( XSAttGroupDecl agd : getAttGroups() )
        v.addAll(agd.getAttributeUses());
    return v;
}
 
Example #12
Source File: AttributesHolder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Iterator<XSAttGroupDecl> iterateAttGroups() {
    return new Iterators.Adapter<XSAttGroupDecl,Ref.AttGroup>(attGroups.iterator()) {
        protected XSAttGroupDecl filter(AttGroup u) {
            return u.get();
        }
    };
}
 
Example #13
Source File: SchemaTreeTraverser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void schema(XSSchema s) {
    // QUICK HACK: don't print the built-in components
    if (s.getTargetNamespace().equals(Const.schemaNamespace)) {
        return;
    }

    SchemaTreeNode newNode = new SchemaTreeNode("Schema "
            + s.getLocator().getSystemId(), s.getLocator());
    this.currNode = newNode;
    this.model.addSchemaNode(newNode);

    for (XSAttGroupDecl groupDecl : s.getAttGroupDecls().values()) {
        attGroupDecl(groupDecl);
    }

    for (XSAttributeDecl attrDecl : s.getAttributeDecls().values()) {
        attributeDecl(attrDecl);
    }

    for (XSComplexType complexType : s.getComplexTypes().values()) {
        complexType(complexType);
    }

    for (XSElementDecl elementDecl : s.getElementDecls().values()) {
        elementDecl(elementDecl);
    }

    for (XSModelGroupDecl modelGroupDecl : s.getModelGroupDecls().values()) {
        modelGroupDecl(modelGroupDecl);
    }

    for (XSSimpleType simpleType : s.getSimpleTypes().values()) {
        simpleType(simpleType);
    }
}
 
Example #14
Source File: SchemaTreeTraverser.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates node for complex type.
 *
 * @param type Complex type.
 */
private void dumpComplexTypeAttribute(XSComplexType type) {
    Iterator itr;

    itr = type.iterateAttGroups();
    while (itr.hasNext()) {
        dumpRef((XSAttGroupDecl) itr.next());
    }

    itr = type.iterateDeclaredAttributeUses();
    while (itr.hasNext()) {
        attributeUse((XSAttributeUse) itr.next());
    }
}
 
Example #15
Source File: AttributesHolder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Set<XSAttGroupDecl> getAttGroups() {
    return new AbstractSet<XSAttGroupDecl>() {
        public Iterator<XSAttGroupDecl> iterator() {
            return iterateAttGroups();
        }

        public int size() {
            return attGroups.size();
        }
    };
}
 
Example #16
Source File: SchemaTreeTraverser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void schema(XSSchema s) {
    // QUICK HACK: don't print the built-in components
    if (s.getTargetNamespace().equals(Const.schemaNamespace)) {
        return;
    }

    SchemaTreeNode newNode = new SchemaTreeNode("Schema "
            + s.getLocator().getSystemId(), s.getLocator());
    this.currNode = newNode;
    this.model.addSchemaNode(newNode);

    for (XSAttGroupDecl groupDecl : s.getAttGroupDecls().values()) {
        attGroupDecl(groupDecl);
    }

    for (XSAttributeDecl attrDecl : s.getAttributeDecls().values()) {
        attributeDecl(attrDecl);
    }

    for (XSComplexType complexType : s.getComplexTypes().values()) {
        complexType(complexType);
    }

    for (XSElementDecl elementDecl : s.getElementDecls().values()) {
        elementDecl(elementDecl);
    }

    for (XSModelGroupDecl modelGroupDecl : s.getModelGroupDecls().values()) {
        modelGroupDecl(modelGroupDecl);
    }

    for (XSSimpleType simpleType : s.getSimpleTypes().values()) {
        simpleType(simpleType);
    }
}
 
Example #17
Source File: AttributesHolder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Set<XSAttGroupDecl> getAttGroups() {
    return new AbstractSet<XSAttGroupDecl>() {
        public Iterator<XSAttGroupDecl> iterator() {
            return iterateAttGroups();
        }

        public int size() {
            return attGroups.size();
        }
    };
}
 
Example #18
Source File: AttributesHolder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the attribute uses by looking at attribute groups and etc.
 * Searching for the base type is done in {@link ComplexTypeImpl}.
 */
public Collection<XSAttributeUse> getAttributeUses() {
    // TODO: this is fairly inefficient
    List<XSAttributeUse> v = new ArrayList<XSAttributeUse>();
    v.addAll(attributes.values());
    for( XSAttGroupDecl agd : getAttGroups() )
        v.addAll(agd.getAttributeUses());
    return v;
}
 
Example #19
Source File: AttributesHolder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public Iterator<XSAttGroupDecl> iterateAttGroups() {
    return new Iterators.Adapter<XSAttGroupDecl,Ref.AttGroup>(attGroups.iterator()) {
        protected XSAttGroupDecl filter(AttGroup u) {
            return u.get();
        }
    };
}
 
Example #20
Source File: SchemaWriter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void schema( XSSchema s ) {

        // QUICK HACK: don't print the built-in components
        if(s.getTargetNamespace().equals(Const.schemaNamespace))
            return;

        println(MessageFormat.format("<schema targetNamespace=\"{0}\">", s.getTargetNamespace()));
        indent++;

        Iterator itr;

        itr = s.iterateAttGroupDecls();
        while(itr.hasNext())
            attGroupDecl( (XSAttGroupDecl)itr.next() );

        itr = s.iterateAttributeDecls();
        while(itr.hasNext())
            attributeDecl( (XSAttributeDecl)itr.next() );

        itr = s.iterateComplexTypes();
        while(itr.hasNext())
            complexType( (XSComplexType)itr.next() );

        itr = s.iterateElementDecls();
        while(itr.hasNext())
            elementDecl( (XSElementDecl)itr.next() );

        itr = s.iterateModelGroupDecls();
        while(itr.hasNext())
            modelGroupDecl( (XSModelGroupDecl)itr.next() );

        itr = s.iterateSimpleTypes();
        while(itr.hasNext())
            simpleType( (XSSimpleType)itr.next() );

        indent--;
        println("</schema>");
    }
 
Example #21
Source File: SchemaTreeTraverser.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates node for complex type.
 *
 * @param type Complex type.
 */
private void dumpComplexTypeAttribute(XSComplexType type) {
    Iterator itr;

    itr = type.iterateAttGroups();
    while (itr.hasNext()) {
        dumpRef((XSAttGroupDecl) itr.next());
    }

    itr = type.iterateDeclaredAttributeUses();
    while (itr.hasNext()) {
        attributeUse((XSAttributeUse) itr.next());
    }
}
 
Example #22
Source File: SchemaTreeTraverser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates node for complex type.
 *
 * @param type Complex type.
 */
private void dumpComplexTypeAttribute(XSComplexType type) {
    Iterator itr;

    itr = type.iterateAttGroups();
    while (itr.hasNext()) {
        dumpRef((XSAttGroupDecl) itr.next());
    }

    itr = type.iterateDeclaredAttributeUses();
    while (itr.hasNext()) {
        attributeUse((XSAttributeUse) itr.next());
    }
}
 
Example #23
Source File: AttGroupDeclImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public XSAttributeUse getAttributeUse( String nsURI, String localName ) {
    UName name = new UName(nsURI,localName);
    XSAttributeUse o=null;

    Iterator itr = iterateAttGroups();
    while(itr.hasNext() && o==null)
        o = ((XSAttGroupDecl)itr.next()).getAttributeUse(nsURI,localName);

    if(o==null)     o = attributes.get(name);

    return o;
}
 
Example #24
Source File: AttGroupDeclImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public XSAttributeUse getAttributeUse( String nsURI, String localName ) {
    UName name = new UName(nsURI,localName);
    XSAttributeUse o=null;

    Iterator itr = iterateAttGroups();
    while(itr.hasNext() && o==null)
        o = ((XSAttGroupDecl)itr.next()).getAttributeUse(nsURI,localName);

    if(o==null)     o = attributes.get(name);

    return o;
}
 
Example #25
Source File: SchemaWriter.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void schema( XSSchema s ) {

        // QUICK HACK: don't print the built-in components
        if(s.getTargetNamespace().equals(Const.schemaNamespace))
            return;

        println(MessageFormat.format("<schema targetNamespace=\"{0}\">", s.getTargetNamespace()));
        indent++;

        Iterator itr;

        itr = s.iterateAttGroupDecls();
        while(itr.hasNext())
            attGroupDecl( (XSAttGroupDecl)itr.next() );

        itr = s.iterateAttributeDecls();
        while(itr.hasNext())
            attributeDecl( (XSAttributeDecl)itr.next() );

        itr = s.iterateComplexTypes();
        while(itr.hasNext())
            complexType( (XSComplexType)itr.next() );

        itr = s.iterateElementDecls();
        while(itr.hasNext())
            elementDecl( (XSElementDecl)itr.next() );

        itr = s.iterateModelGroupDecls();
        while(itr.hasNext())
            modelGroupDecl( (XSModelGroupDecl)itr.next() );

        itr = s.iterateSimpleTypes();
        while(itr.hasNext())
            simpleType( (XSSimpleType)itr.next() );

        indent--;
        println("</schema>");
    }
 
Example #26
Source File: SchemaTreeTraverser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates node for complex type.
 *
 * @param type Complex type.
 */
private void dumpComplexTypeAttribute(XSComplexType type) {
    Iterator itr;

    itr = type.iterateAttGroups();
    while (itr.hasNext()) {
        dumpRef((XSAttGroupDecl) itr.next());
    }

    itr = type.iterateDeclaredAttributeUses();
    while (itr.hasNext()) {
        attributeUse((XSAttributeUse) itr.next());
    }
}
 
Example #27
Source File: SchemaSetImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public XSAttGroupDecl getAttGroupDecl( String ns, String localName ) {
    XSSchema schema = getSchema(ns);
    if(schema==null)    return null;

    return schema.getAttGroupDecl(localName);
}
 
Example #28
Source File: SchemaImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void addAttGroupDecl(XSAttGroupDecl newDecl, boolean overwrite) {
    if(overwrite || !attGroups.containsKey(newDecl.getName()))
        attGroups.put(newDecl.getName(), newDecl);
}
 
Example #29
Source File: SchemaImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public XSAttGroupDecl getAttGroupDecl(String name) {
    return attGroups.get(name);
}
 
Example #30
Source File: SchemaImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public Map<String,XSAttGroupDecl> getAttGroupDecls() {
    return attGroupsView;
}