com.sun.tools.internal.xjc.reader.gbind.Element Java Examples

The following examples show how to use com.sun.tools.internal.xjc.reader.gbind.Element. 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: ExpressionParticleBinder.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Finds a {@link XSParticle} that can serve as the representative property of
 * the given {@link ConnectedComponent}.
 *
 * The representative property is used for reporting an error location and
 * taking {@link BIProperty} customization. Right now, the algorithm is just pick
 * the first one with {@link BIProperty}, but one can think of a better algorithm,
 * such as taking a choice of (A|B) if CC={A,B}.
 */
private XSParticle findSourceParticle(ConnectedComponent cc) {
    XSParticle first = null;

    for (Element e : cc) {
        GElement ge = (GElement)e;
        for (XSParticle p : ge.particles) {
            if(first==null)
                first = p;
            if(getLocalPropCustomization(p)!=null)
                return p;
        }
        // if there are multiple property customizations,
        // all but one will be left unused, which will be detected as an error
        // later, so no need to check that now.
    }

    // if no customization was found, just use the first one.
    return first;
}
 
Example #2
Source File: ExpressionParticleBinder.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Finds a {@link XSParticle} that can serve as the representative property of
 * the given {@link ConnectedComponent}.
 *
 * The representative property is used for reporting an error location and
 * taking {@link BIProperty} customization. Right now, the algorithm is just pick
 * the first one with {@link BIProperty}, but one can think of a better algorithm,
 * such as taking a choice of (A|B) if CC={A,B}.
 */
private XSParticle findSourceParticle(ConnectedComponent cc) {
    XSParticle first = null;

    for (Element e : cc) {
        GElement ge = (GElement)e;
        for (XSParticle p : ge.particles) {
            if(first==null)
                first = p;
            if(getLocalPropCustomization(p)!=null)
                return p;
        }
        // if there are multiple property customizations,
        // all but one will be left unused, which will be detected as an error
        // later, so no need to check that now.
    }

    // if no customization was found, just use the first one.
    return first;
}
 
Example #3
Source File: ExpressionParticleBinder.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Finds a {@link XSParticle} that can serve as the representative property of
 * the given {@link ConnectedComponent}.
 *
 * The representative property is used for reporting an error location and
 * taking {@link BIProperty} customization. Right now, the algorithm is just pick
 * the first one with {@link BIProperty}, but one can think of a better algorithm,
 * such as taking a choice of (A|B) if CC={A,B}.
 */
private XSParticle findSourceParticle(ConnectedComponent cc) {
    XSParticle first = null;

    for (Element e : cc) {
        GElement ge = (GElement)e;
        for (XSParticle p : ge.particles) {
            if(first==null)
                first = p;
            if(getLocalPropCustomization(p)!=null)
                return p;
        }
        // if there are multiple property customizations,
        // all but one will be left unused, which will be detected as an error
        // later, so no need to check that now.
    }

    // if no customization was found, just use the first one.
    return first;
}
 
Example #4
Source File: ExpressionParticleBinder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Finds a {@link XSParticle} that can serve as the representative property of
 * the given {@link ConnectedComponent}.
 *
 * The representative property is used for reporting an error location and
 * taking {@link BIProperty} customization. Right now, the algorithm is just pick
 * the first one with {@link BIProperty}, but one can think of a better algorithm,
 * such as taking a choice of (A|B) if CC={A,B}.
 */
private XSParticle findSourceParticle(ConnectedComponent cc) {
    XSParticle first = null;

    for (Element e : cc) {
        GElement ge = (GElement)e;
        for (XSParticle p : ge.particles) {
            if(first==null)
                first = p;
            if(getLocalPropCustomization(p)!=null)
                return p;
        }
        // if there are multiple property customizations,
        // all but one will be left unused, which will be detected as an error
        // later, so no need to check that now.
    }

    // if no customization was found, just use the first one.
    return first;
}
 
Example #5
Source File: ExpressionParticleBinder.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Finds a {@link XSParticle} that can serve as the representative property of
 * the given {@link ConnectedComponent}.
 *
 * The representative property is used for reporting an error location and
 * taking {@link BIProperty} customization. Right now, the algorithm is just pick
 * the first one with {@link BIProperty}, but one can think of a better algorithm,
 * such as taking a choice of (A|B) if CC={A,B}.
 */
private XSParticle findSourceParticle(ConnectedComponent cc) {
    XSParticle first = null;

    for (Element e : cc) {
        GElement ge = (GElement)e;
        for (XSParticle p : ge.particles) {
            if(first==null)
                first = p;
            if(getLocalPropCustomization(p)!=null)
                return p;
        }
        // if there are multiple property customizations,
        // all but one will be left unused, which will be detected as an error
        // later, so no need to check that now.
    }

    // if no customization was found, just use the first one.
    return first;
}
 
Example #6
Source File: ExpressionParticleBinder.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Finds a {@link XSParticle} that can serve as the representative property of
 * the given {@link ConnectedComponent}.
 *
 * The representative property is used for reporting an error location and
 * taking {@link BIProperty} customization. Right now, the algorithm is just pick
 * the first one with {@link BIProperty}, but one can think of a better algorithm,
 * such as taking a choice of (A|B) if CC={A,B}.
 */
private XSParticle findSourceParticle(ConnectedComponent cc) {
    XSParticle first = null;

    for (Element e : cc) {
        GElement ge = (GElement)e;
        for (XSParticle p : ge.particles) {
            if(first==null)
                first = p;
            if(getLocalPropCustomization(p)!=null)
                return p;
        }
        // if there are multiple property customizations,
        // all but one will be left unused, which will be detected as an error
        // later, so no need to check that now.
    }

    // if no customization was found, just use the first one.
    return first;
}
 
Example #7
Source File: ExpressionParticleBinder.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Finds a {@link XSParticle} that can serve as the representative property of
 * the given {@link ConnectedComponent}.
 *
 * The representative property is used for reporting an error location and
 * taking {@link BIProperty} customization. Right now, the algorithm is just pick
 * the first one with {@link BIProperty}, but one can think of a better algorithm,
 * such as taking a choice of (A|B) if CC={A,B}.
 */
private XSParticle findSourceParticle(ConnectedComponent cc) {
    XSParticle first = null;

    for (Element e : cc) {
        GElement ge = (GElement)e;
        for (XSParticle p : ge.particles) {
            if(first==null)
                first = p;
            if(getLocalPropCustomization(p)!=null)
                return p;
        }
        // if there are multiple property customizations,
        // all but one will be left unused, which will be detected as an error
        // later, so no need to check that now.
    }

    // if no customization was found, just use the first one.
    return first;
}
 
Example #8
Source File: ExpressionParticleBinder.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Finds a {@link XSParticle} that can serve as the representative property of
 * the given {@link ConnectedComponent}.
 *
 * The representative property is used for reporting an error location and
 * taking {@link BIProperty} customization. Right now, the algorithm is just pick
 * the first one with {@link BIProperty}, but one can think of a better algorithm,
 * such as taking a choice of (A|B) if CC={A,B}.
 */
private XSParticle findSourceParticle(ConnectedComponent cc) {
    XSParticle first = null;

    for (Element e : cc) {
        GElement ge = (GElement)e;
        for (XSParticle p : ge.particles) {
            if(first==null)
                first = p;
            if(getLocalPropCustomization(p)!=null)
                return p;
        }
        // if there are multiple property customizations,
        // all but one will be left unused, which will be detected as an error
        // later, so no need to check that now.
    }

    // if no customization was found, just use the first one.
    return first;
}
 
Example #9
Source File: ExpressionBuilder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Element elementDecl(XSElementDecl decl) {
    QName n = BGMBuilder.getName(decl);

    GElementImpl e = decls.get(n);
    if(e==null)
        decls.put(n,e=new GElementImpl(n,decl));

    e.particles.add(current);
    assert current.getTerm()==decl;

    return e;
}
 
Example #10
Source File: ExpressionBuilder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Element elementDecl(XSElementDecl decl) {
    QName n = BGMBuilder.getName(decl);

    GElementImpl e = decls.get(n);
    if(e==null)
        decls.put(n,e=new GElementImpl(n,decl));

    e.particles.add(current);
    assert current.getTerm()==decl;

    return e;
}
 
Example #11
Source File: ExpressionBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Element elementDecl(XSElementDecl decl) {
    QName n = BGMBuilder.getName(decl);

    GElementImpl e = decls.get(n);
    if(e==null)
        decls.put(n,e=new GElementImpl(n,decl));

    e.particles.add(current);
    assert current.getTerm()==decl;

    return e;
}
 
Example #12
Source File: ExpressionBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Element elementDecl(XSElementDecl decl) {
    QName n = BGMBuilder.getName(decl);

    GElementImpl e = decls.get(n);
    if(e==null)
        decls.put(n,e=new GElementImpl(n,decl));

    e.particles.add(current);
    assert current.getTerm()==decl;

    return e;
}
 
Example #13
Source File: ExpressionBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public Element elementDecl(XSElementDecl decl) {
    QName n = BGMBuilder.getName(decl);

    GElementImpl e = decls.get(n);
    if(e==null)
        decls.put(n,e=new GElementImpl(n,decl));

    e.particles.add(current);
    assert current.getTerm()==decl;

    return e;
}
 
Example #14
Source File: ExpressionBuilder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public Element elementDecl(XSElementDecl decl) {
    QName n = BGMBuilder.getName(decl);

    GElementImpl e = decls.get(n);
    if(e==null)
        decls.put(n,e=new GElementImpl(n,decl));

    e.particles.add(current);
    assert current.getTerm()==decl;

    return e;
}
 
Example #15
Source File: ExpressionBuilder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Element elementDecl(XSElementDecl decl) {
    QName n = BGMBuilder.getName(decl);

    GElementImpl e = decls.get(n);
    if(e==null)
        decls.put(n,e=new GElementImpl(n,decl));

    e.particles.add(current);
    assert current.getTerm()==decl;

    return e;
}
 
Example #16
Source File: ExpressionBuilder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Element elementDecl(XSElementDecl decl) {
    QName n = BGMBuilder.getName(decl);

    GElementImpl e = decls.get(n);
    if(e==null)
        decls.put(n,e=new GElementImpl(n,decl));

    e.particles.add(current);
    assert current.getTerm()==decl;

    return e;
}