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

The following examples show how to use com.sun.xml.internal.xsom.XSWildcard. 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: ExpressionBuilder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * We can only have one {@link XmlAnyElement} property,
 * so all the wildcards need to be treated as one node.
 */
public Expression wildcard(XSWildcard wc) {
    if(wildcard==null)
        wildcard = new GWildcardElement();
    wildcard.merge(wc);
    wildcard.particles.add(current);
    return wildcard;
}
 
Example #2
Source File: SchemaWriter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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() );

    XSWildcard awc = type.getAttributeWildcard();
    if(awc!=null)
        wildcard("anyAttribute",awc,"");
}
 
Example #3
Source File: UnusedCustomizationChecker.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void attContainer( XSAttContainer cont ) {
    for( Iterator itr = cont.iterateAttGroups(); itr.hasNext(); )
        ((XSAttGroupDecl)itr.next()).visit(this);

    for( Iterator itr = cont.iterateDeclaredAttributeUses(); itr.hasNext(); )
        ((XSAttributeUse)itr.next()).visit(this);

    XSWildcard wc = cont.getAttributeWildcard();
    if(wc!=null)        wc.visit(this);
}
 
Example #4
Source File: BindGreen.java    From openjdk-jdk9 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 #5
Source File: SchemaWriter.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void wildcard( String tagName, XSWildcard wc, String extraAtts ) {
    final String proessContents;
    switch(wc.getMode()) {
    case XSWildcard.LAX:
        proessContents = " processContents='lax'";break;
    case XSWildcard.STRTICT:
        proessContents = "";break;
    case XSWildcard.SKIP:
        proessContents = " processContents='skip'";break;
    default:
        throw new AssertionError();
    }

    println(MessageFormat.format("<{0}{1}{2}{3}/>",tagName, proessContents, wc.apply(WILDCARD_NS), extraAtts));
}
 
Example #6
Source File: ExpressionBuilder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * We can only have one {@link XmlAnyElement} property,
 * so all the wildcards need to be treated as one node.
 */
public Expression wildcard(XSWildcard wc) {
    if(wildcard==null)
        wildcard = new GWildcardElement();
    wildcard.merge(wc);
    wildcard.particles.add(current);
    return wildcard;
}
 
Example #7
Source File: SchemaTreeTraverser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates node for wild card with additional attributes.
 *
 * @param wc        Wild card.
 * @param extraAtts Additional attributes.
 */
private void wildcard(XSWildcard wc, String extraAtts) {
    // TODO
    SchemaTreeNode newNode = new SchemaTreeNode(MessageFormat.format(
            "Any ", new Object[]{extraAtts}), wc.getLocator());
    currNode.add(newNode);
}
 
Example #8
Source File: BindRed.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void wildcard(XSWildcard xsWildcard) {
    // TODO: implement this method later
    // I guess we might allow this to be mapped to a generic element property ---
    // not sure exactly how do we do it.
    TODO.checkSpec();
    throw new UnsupportedOperationException();
}
 
Example #9
Source File: SchemaTreeTraverser.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates node for wild card with additional attributes.
 *
 * @param wc        Wild card.
 * @param extraAtts Additional attributes.
 */
private void wildcard(XSWildcard wc, String extraAtts) {
    // TODO
    SchemaTreeNode newNode = new SchemaTreeNode(MessageFormat.format(
            "Any ", new Object[]{extraAtts}), wc.getLocator());
    currNode.add(newNode);
}
 
Example #10
Source File: BindRed.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void wildcard(XSWildcard xsWildcard) {
    // TODO: implement this method later
    // I guess we might allow this to be mapped to a generic element property ---
    // not sure exactly how do we do it.
    TODO.checkSpec();
    throw new UnsupportedOperationException();
}
 
Example #11
Source File: WildcardNameClassBuilder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public NameClass union(XSWildcard.Union wc) {
    NameClass nc = null;
    for (Iterator itr = wc.iterateNamespaces(); itr.hasNext();) {
        String ns = (String) itr.next();

        if(nc==null)    nc = new NsNameClass(ns);
        else
            nc = new ChoiceNameClass(nc,new NsNameClass(ns));
    }

    // there should be at least one.
    assert nc!=null;

    return nc;
}
 
Example #12
Source File: ComplexTypeImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public XSWildcard getAttributeWildcard() {
    WildcardImpl complete = localAttWildcard;

    Iterator itr = iterateAttGroups();
    while( itr.hasNext() ) {
        WildcardImpl w = (WildcardImpl)((XSAttGroupDecl)itr.next()).getAttributeWildcard();

        if(w==null)     continue;

        if(complete==null)
            complete = w;
        else
            // TODO: the spec says it's intersection,
            // but I think it has to be union.
            complete = complete.union(ownerDocument,w);
    }

    if( getDerivationMethod()==RESTRICTION )    return complete;

    WildcardImpl base=null;
    XSType baseType = getBaseType();
    if(baseType.asComplexType()!=null)
        base = (WildcardImpl)baseType.asComplexType().getAttributeWildcard();

    if(complete==null)  return base;
    if(base==null)      return complete;

    return complete.union(ownerDocument,base);
}
 
Example #13
Source File: ComplexTypeImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public XSWildcard getAttributeWildcard() {
    WildcardImpl complete = localAttWildcard;

    Iterator itr = iterateAttGroups();
    while( itr.hasNext() ) {
        WildcardImpl w = (WildcardImpl)((XSAttGroupDecl)itr.next()).getAttributeWildcard();

        if(w==null)     continue;

        if(complete==null)
            complete = w;
        else
            // TODO: the spec says it's intersection,
            // but I think it has to be union.
            complete = complete.union(ownerDocument,w);
    }

    if( getDerivationMethod()==RESTRICTION )    return complete;

    WildcardImpl base=null;
    XSType baseType = getBaseType();
    if(baseType.asComplexType()!=null)
        base = (WildcardImpl)baseType.asComplexType().getAttributeWildcard();

    if(complete==null)  return base;
    if(base==null)      return complete;

    return complete.union(ownerDocument,base);
}
 
Example #14
Source File: BindGreen.java    From openjdk-jdk8u-backup 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 #15
Source File: ExpressionBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * We can only have one {@link XmlAnyElement} property,
 * so all the wildcards need to be treated as one node.
 */
public Expression wildcard(XSWildcard wc) {
    if(wildcard==null)
        wildcard = new GWildcardElement();
    wildcard.merge(wc);
    wildcard.particles.add(current);
    return wildcard;
}
 
Example #16
Source File: RawTypeSetBuilder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static WildcardMode getMode(XSWildcard wildcard) {
    switch(wildcard.getMode()) {
    case XSWildcard.LAX:
        return WildcardMode.LAX;
    case XSWildcard.STRTICT:
        return WildcardMode.STRICT;
    case XSWildcard.SKIP:
        return WildcardMode.SKIP;
    default:
        throw new IllegalStateException();
    }
}
 
Example #17
Source File: BindRed.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void wildcard(XSWildcard xsWildcard) {
    // TODO: implement this method later
    // I guess we might allow this to be mapped to a generic element property ---
    // not sure exactly how do we do it.
    TODO.checkSpec();
    throw new UnsupportedOperationException();
}
 
Example #18
Source File: GWildcardElement.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void merge(XSWildcard wc) {
    switch(wc.getMode()) {
    case XSWildcard.LAX:
    case XSWildcard.SKIP:
        strict = false;
    }
}
 
Example #19
Source File: SchemaWriter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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() );

    XSWildcard awc = type.getAttributeWildcard();
    if(awc!=null)
        wildcard("anyAttribute",awc,"");
}
 
Example #20
Source File: ComplexTypeImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public XSWildcard getAttributeWildcard() {
    WildcardImpl complete = localAttWildcard;

    Iterator itr = iterateAttGroups();
    while( itr.hasNext() ) {
        WildcardImpl w = (WildcardImpl)((XSAttGroupDecl)itr.next()).getAttributeWildcard();

        if(w==null)     continue;

        if(complete==null)
            complete = w;
        else
            // TODO: the spec says it's intersection,
            // but I think it has to be union.
            complete = complete.union(ownerDocument,w);
    }

    if( getDerivationMethod()==RESTRICTION )    return complete;

    WildcardImpl base=null;
    XSType baseType = getBaseType();
    if(baseType.asComplexType()!=null)
        base = (WildcardImpl)baseType.asComplexType().getAttributeWildcard();

    if(complete==null)  return base;
    if(base==null)      return complete;

    return complete.union(ownerDocument,base);
}
 
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 wild card with additional attributes.
 *
 * @param wc        Wild card.
 * @param extraAtts Additional attributes.
 */
private void wildcard(XSWildcard wc, String extraAtts) {
    // TODO
    SchemaTreeNode newNode = new SchemaTreeNode(MessageFormat.format(
            "Any ", new Object[]{extraAtts}), wc.getLocator());
    currNode.add(newNode);
}
 
Example #22
Source File: WildcardNameClassBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public NameClass any(XSWildcard.Any wc) {
    return NameClass.ANY;
}
 
Example #23
Source File: AbstractExtendedComplexTypeBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public NameClass wildcard(XSWildcard wc) {
    return WildcardNameClassBuilder.build(wc);
}
 
Example #24
Source File: DefaultClassBinder.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public CClassInfo wildcard(XSWildcard wc) {
    return never();
}
 
Example #25
Source File: WildcardNameClassBuilder.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public NameClass any(XSWildcard.Any wc) {
    return NameClass.ANY;
}
 
Example #26
Source File: MultiplicityCounter.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public Multiplicity wildcard(XSWildcard wc) {
    return ONE;
}
 
Example #27
Source File: DefaultClassBinder.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public CClassInfo wildcard(XSWildcard wc) {
    return never();
}
 
Example #28
Source File: AbstractExtendedComplexTypeBuilder.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public NameClass wildcard(XSWildcard wc) {
    return WildcardNameClassBuilder.build(wc);
}
 
Example #29
Source File: MultiplicityCounter.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public Multiplicity wildcard(XSWildcard wc) {
    return ONE;
}
 
Example #30
Source File: ClassBinderFilter.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public CElement wildcard(XSWildcard xsWildcard) {
    return core.wildcard(xsWildcard);
}