com.sun.tools.internal.xjc.reader.dtd.bindinfo.BIElement Java Examples

The following examples show how to use com.sun.tools.internal.xjc.reader.dtd.bindinfo.BIElement. 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: TDTDReader.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates constructor declarations as specified in the
 * binding information.
 *
 * <p>
 * Also checks that the binding file does not contain
 * declarations for non-existent elements.
 */
private void processConstructorDeclarations() {
    for( BIElement decl: bindInfo.elements() ) {
        Element e = elements.get(decl.name());
        if(e==null) {
            error(decl.getSourceLocation(),
                Messages.ERR_BINDINFO_NON_EXISTENT_ELEMENT_DECLARATION,decl.name());
            continue;   // continue to process next declaration
        }

        if(!decl.isClass())
            // only element-class declaration has constructor definitions
            continue;

        decl.declareConstructors(e.getClassInfo());
    }
}
 
Example #2
Source File: Element.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private CClassInfo calcClass() {
    BIElement e = owner.bindInfo.element(name);
    if(e==null) {
        if(contentModelType!=DTDEventListener.CONTENT_MODEL_MIXED
        || !attributes.isEmpty()
        || mustBeClass)
            return createDefaultClass();
        if(contentModel!=Term.EMPTY) {
            throw new UnsupportedOperationException("mixed content model not supported");
        } else {
            // just #PCDATA
            if(isReferenced)
                return null;
            else
                // if no one else is referencing, assumed to be the root.
                return createDefaultClass();
        }
    } else {
        return e.clazz;
    }
}
 
Example #3
Source File: TDTDReader.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates constructor declarations as specified in the
 * binding information.
 *
 * <p>
 * Also checks that the binding file does not contain
 * declarations for non-existent elements.
 */
private void processConstructorDeclarations() {
    for( BIElement decl: bindInfo.elements() ) {
        Element e = elements.get(decl.name());
        if(e==null) {
            error(decl.getSourceLocation(),
                Messages.ERR_BINDINFO_NON_EXISTENT_ELEMENT_DECLARATION,decl.name());
            continue;   // continue to process next declaration
        }

        if(!decl.isClass())
            // only element-class declaration has constructor definitions
            continue;

        decl.declareConstructors(e.getClassInfo());
    }
}
 
Example #4
Source File: Element.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private CClassInfo calcClass() {
    BIElement e = owner.bindInfo.element(name);
    if(e==null) {
        if(contentModelType!=DTDEventListener.CONTENT_MODEL_MIXED
        || !attributes.isEmpty()
        || mustBeClass)
            return createDefaultClass();
        if(contentModel!=Term.EMPTY) {
            throw new UnsupportedOperationException("mixed content model not supported");
        } else {
            // just #PCDATA
            if(isReferenced)
                return null;
            else
                // if no one else is referencing, assumed to be the root.
                return createDefaultClass();
        }
    } else {
        return e.clazz;
    }
}
 
Example #5
Source File: TDTDReader.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates constructor declarations as specified in the
 * binding information.
 *
 * <p>
 * Also checks that the binding file does not contain
 * declarations for non-existent elements.
 */
private void processConstructorDeclarations() {
    for( BIElement decl: bindInfo.elements() ) {
        Element e = elements.get(decl.name());
        if(e==null) {
            error(decl.getSourceLocation(),
                Messages.ERR_BINDINFO_NON_EXISTENT_ELEMENT_DECLARATION,decl.name());
            continue;   // continue to process next declaration
        }

        if(!decl.isClass())
            // only element-class declaration has constructor definitions
            continue;

        decl.declareConstructors(e.getClassInfo());
    }
}
 
Example #6
Source File: Element.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private CClassInfo calcClass() {
    BIElement e = owner.bindInfo.element(name);
    if(e==null) {
        if(contentModelType!=DTDEventListener.CONTENT_MODEL_MIXED
        || !attributes.isEmpty()
        || mustBeClass)
            return createDefaultClass();
        if(contentModel!=Term.EMPTY) {
            throw new UnsupportedOperationException("mixed content model not supported");
        } else {
            // just #PCDATA
            if(isReferenced)
                return null;
            else
                // if no one else is referencing, assumed to be the root.
                return createDefaultClass();
        }
    } else {
        return e.clazz;
    }
}
 
Example #7
Source File: TDTDReader.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates constructor declarations as specified in the
 * binding information.
 *
 * <p>
 * Also checks that the binding file does not contain
 * declarations for non-existent elements.
 */
private void processConstructorDeclarations() {
    for( BIElement decl: bindInfo.elements() ) {
        Element e = elements.get(decl.name());
        if(e==null) {
            error(decl.getSourceLocation(),
                Messages.ERR_BINDINFO_NON_EXISTENT_ELEMENT_DECLARATION,decl.name());
            continue;   // continue to process next declaration
        }

        if(!decl.isClass())
            // only element-class declaration has constructor definitions
            continue;

        decl.declareConstructors(e.getClassInfo());
    }
}
 
Example #8
Source File: Element.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private CClassInfo calcClass() {
    BIElement e = owner.bindInfo.element(name);
    if(e==null) {
        if(contentModelType!=DTDEventListener.CONTENT_MODEL_MIXED
        || !attributes.isEmpty()
        || mustBeClass)
            return createDefaultClass();
        if(contentModel!=Term.EMPTY) {
            throw new UnsupportedOperationException("mixed content model not supported");
        } else {
            // just #PCDATA
            if(isReferenced)
                return null;
            else
                // if no one else is referencing, assumed to be the root.
                return createDefaultClass();
        }
    } else {
        return e.clazz;
    }
}
 
Example #9
Source File: TDTDReader.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates constructor declarations as specified in the
 * binding information.
 *
 * <p>
 * Also checks that the binding file does not contain
 * declarations for non-existent elements.
 */
private void processConstructorDeclarations() {
    for( BIElement decl: bindInfo.elements() ) {
        Element e = elements.get(decl.name());
        if(e==null) {
            error(decl.getSourceLocation(),
                Messages.ERR_BINDINFO_NON_EXISTENT_ELEMENT_DECLARATION,decl.name());
            continue;   // continue to process next declaration
        }

        if(!decl.isClass())
            // only element-class declaration has constructor definitions
            continue;

        decl.declareConstructors(e.getClassInfo());
    }
}
 
Example #10
Source File: Element.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private CClassInfo calcClass() {
    BIElement e = owner.bindInfo.element(name);
    if(e==null) {
        if(contentModelType!=DTDEventListener.CONTENT_MODEL_MIXED
        || !attributes.isEmpty()
        || mustBeClass)
            return createDefaultClass();
        if(contentModel!=Term.EMPTY) {
            throw new UnsupportedOperationException("mixed content model not supported");
        } else {
            // just #PCDATA
            if(isReferenced)
                return null;
            else
                // if no one else is referencing, assumed to be the root.
                return createDefaultClass();
        }
    } else {
        return e.clazz;
    }
}
 
Example #11
Source File: TDTDReader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates constructor declarations as specified in the
 * binding information.
 *
 * <p>
 * Also checks that the binding file does not contain
 * declarations for non-existent elements.
 */
private void processConstructorDeclarations() {
    for( BIElement decl: bindInfo.elements() ) {
        Element e = elements.get(decl.name());
        if(e==null) {
            error(decl.getSourceLocation(),
                Messages.ERR_BINDINFO_NON_EXISTENT_ELEMENT_DECLARATION,decl.name());
            continue;   // continue to process next declaration
        }

        if(!decl.isClass())
            // only element-class declaration has constructor definitions
            continue;

        decl.declareConstructors(e.getClassInfo());
    }
}
 
Example #12
Source File: Element.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private CClassInfo calcClass() {
    BIElement e = owner.bindInfo.element(name);
    if(e==null) {
        if(contentModelType!=DTDEventListener.CONTENT_MODEL_MIXED
        || !attributes.isEmpty()
        || mustBeClass)
            return createDefaultClass();
        if(contentModel!=Term.EMPTY) {
            throw new UnsupportedOperationException("mixed content model not supported");
        } else {
            // just #PCDATA
            if(isReferenced)
                return null;
            else
                // if no one else is referencing, assumed to be the root.
                return createDefaultClass();
        }
    } else {
        return e.clazz;
    }
}
 
Example #13
Source File: TDTDReader.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates constructor declarations as specified in the
 * binding information.
 *
 * <p>
 * Also checks that the binding file does not contain
 * declarations for non-existent elements.
 */
private void processConstructorDeclarations() {
    for( BIElement decl: bindInfo.elements() ) {
        Element e = elements.get(decl.name());
        if(e==null) {
            error(decl.getSourceLocation(),
                Messages.ERR_BINDINFO_NON_EXISTENT_ELEMENT_DECLARATION,decl.name());
            continue;   // continue to process next declaration
        }

        if(!decl.isClass())
            // only element-class declaration has constructor definitions
            continue;

        decl.declareConstructors(e.getClassInfo());
    }
}
 
Example #14
Source File: Element.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private CClassInfo calcClass() {
    BIElement e = owner.bindInfo.element(name);
    if(e==null) {
        if(contentModelType!=DTDEventListener.CONTENT_MODEL_MIXED
        || !attributes.isEmpty()
        || mustBeClass)
            return createDefaultClass();
        if(contentModel!=Term.EMPTY) {
            throw new UnsupportedOperationException("mixed content model not supported");
        } else {
            // just #PCDATA
            if(isReferenced)
                return null;
            else
                // if no one else is referencing, assumed to be the root.
                return createDefaultClass();
        }
    } else {
        return e.clazz;
    }
}
 
Example #15
Source File: TDTDReader.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates constructor declarations as specified in the
 * binding information.
 *
 * <p>
 * Also checks that the binding file does not contain
 * declarations for non-existent elements.
 */
private void processConstructorDeclarations() {
    for( BIElement decl: bindInfo.elements() ) {
        Element e = elements.get(decl.name());
        if(e==null) {
            error(decl.getSourceLocation(),
                Messages.ERR_BINDINFO_NON_EXISTENT_ELEMENT_DECLARATION,decl.name());
            continue;   // continue to process next declaration
        }

        if(!decl.isClass())
            // only element-class declaration has constructor definitions
            continue;

        decl.declareConstructors(e.getClassInfo());
    }
}
 
Example #16
Source File: Element.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private CClassInfo calcClass() {
    BIElement e = owner.bindInfo.element(name);
    if(e==null) {
        if(contentModelType!=DTDEventListener.CONTENT_MODEL_MIXED
        || !attributes.isEmpty()
        || mustBeClass)
            return createDefaultClass();
        if(contentModel!=Term.EMPTY) {
            throw new UnsupportedOperationException("mixed content model not supported");
        } else {
            // just #PCDATA
            if(isReferenced)
                return null;
            else
                // if no one else is referencing, assumed to be the root.
                return createDefaultClass();
        }
    } else {
        return e.clazz;
    }
}
 
Example #17
Source File: TDTDReader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected CPropertyInfo createAttribute(
    String elementName, String attributeName, String attributeType,
    String[] enums, short attributeUse, String defaultValue )
        throws SAXException {

    boolean required = attributeUse==USE_REQUIRED;

    // get the attribute-property declaration
    BIElement edecl = bindInfo.element(elementName);
    BIAttribute decl=null;
    if(edecl!=null)     decl=edecl.attribute(attributeName);

    String propName;
    if(decl==null)  propName = model.getNameConverter().toPropertyName(attributeName);
    else            propName = decl.getPropertyName();

    QName qname = new QName("",attributeName);

    // if no declaration is specified, just wrap it by
    // a FieldItem and let the normalizer handle its content.
    TypeUse use;

    if(decl!=null && decl.getConversion()!=null)
        use = decl.getConversion().getTransducer();
    else
        use = builtinConversions.get(attributeType);

    CPropertyInfo r = new CAttributePropertyInfo(
        propName, null,null/*TODO*/, copyLocator(), qname, use, null, required );

    if(defaultValue!=null)
        r.defaultValue = CDefaultValue.create( use, new XmlString(defaultValue) );

    return r;
}
 
Example #18
Source File: TDTDReader.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected CPropertyInfo createAttribute(
    String elementName, String attributeName, String attributeType,
    String[] enums, short attributeUse, String defaultValue )
        throws SAXException {

    boolean required = attributeUse==USE_REQUIRED;

    // get the attribute-property declaration
    BIElement edecl = bindInfo.element(elementName);
    BIAttribute decl=null;
    if(edecl!=null)     decl=edecl.attribute(attributeName);

    String propName;
    if(decl==null)  propName = model.getNameConverter().toPropertyName(attributeName);
    else            propName = decl.getPropertyName();

    QName qname = new QName("",attributeName);

    // if no declaration is specified, just wrap it by
    // a FieldItem and let the normalizer handle its content.
    TypeUse use;

    if(decl!=null && decl.getConversion()!=null)
        use = decl.getConversion().getTransducer();
    else
        use = builtinConversions.get(attributeType);

    CPropertyInfo r = new CAttributePropertyInfo(
        propName, null,null/*TODO*/, copyLocator(), qname, use, null, required );

    if(defaultValue!=null)
        r.defaultValue = CDefaultValue.create( use, new XmlString(defaultValue) );

    return r;
}
 
Example #19
Source File: TDTDReader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected CPropertyInfo createAttribute(
    String elementName, String attributeName, String attributeType,
    String[] enums, short attributeUse, String defaultValue )
        throws SAXException {

    boolean required = attributeUse==USE_REQUIRED;

    // get the attribute-property declaration
    BIElement edecl = bindInfo.element(elementName);
    BIAttribute decl=null;
    if(edecl!=null)     decl=edecl.attribute(attributeName);

    String propName;
    if(decl==null)  propName = model.getNameConverter().toPropertyName(attributeName);
    else            propName = decl.getPropertyName();

    QName qname = new QName("",attributeName);

    // if no declaration is specified, just wrap it by
    // a FieldItem and let the normalizer handle its content.
    TypeUse use;

    if(decl!=null && decl.getConversion()!=null)
        use = decl.getConversion().getTransducer();
    else
        use = builtinConversions.get(attributeType);

    CPropertyInfo r = new CAttributePropertyInfo(
        propName, null,null/*TODO*/, copyLocator(), qname, use, null, required );

    if(defaultValue!=null)
        r.defaultValue = CDefaultValue.create( use, new XmlString(defaultValue) );

    return r;
}
 
Example #20
Source File: TDTDReader.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected CPropertyInfo createAttribute(
    String elementName, String attributeName, String attributeType,
    String[] enums, short attributeUse, String defaultValue )
        throws SAXException {

    boolean required = attributeUse==USE_REQUIRED;

    // get the attribute-property declaration
    BIElement edecl = bindInfo.element(elementName);
    BIAttribute decl=null;
    if(edecl!=null)     decl=edecl.attribute(attributeName);

    String propName;
    if(decl==null)  propName = model.getNameConverter().toPropertyName(attributeName);
    else            propName = decl.getPropertyName();

    QName qname = new QName("",attributeName);

    // if no declaration is specified, just wrap it by
    // a FieldItem and let the normalizer handle its content.
    TypeUse use;

    if(decl!=null && decl.getConversion()!=null)
        use = decl.getConversion().getTransducer();
    else
        use = builtinConversions.get(attributeType);

    CPropertyInfo r = new CAttributePropertyInfo(
        propName, null,null/*TODO*/, copyLocator(), qname, use, null, required );

    if(defaultValue!=null)
        r.defaultValue = CDefaultValue.create( use, new XmlString(defaultValue) );

    return r;
}
 
Example #21
Source File: TDTDReader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected CPropertyInfo createAttribute(
    String elementName, String attributeName, String attributeType,
    String[] enums, short attributeUse, String defaultValue )
        throws SAXException {

    boolean required = attributeUse==USE_REQUIRED;

    // get the attribute-property declaration
    BIElement edecl = bindInfo.element(elementName);
    BIAttribute decl=null;
    if(edecl!=null)     decl=edecl.attribute(attributeName);

    String propName;
    if(decl==null)  propName = model.getNameConverter().toPropertyName(attributeName);
    else            propName = decl.getPropertyName();

    QName qname = new QName("",attributeName);

    // if no declaration is specified, just wrap it by
    // a FieldItem and let the normalizer handle its content.
    TypeUse use;

    if(decl!=null && decl.getConversion()!=null)
        use = decl.getConversion().getTransducer();
    else
        use = builtinConversions.get(attributeType);

    CPropertyInfo r = new CAttributePropertyInfo(
        propName, null,null/*TODO*/, copyLocator(), qname, use, null, required );

    if(defaultValue!=null)
        r.defaultValue = CDefaultValue.create( use, new XmlString(defaultValue) );

    return r;
}
 
Example #22
Source File: TDTDReader.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected CPropertyInfo createAttribute(
    String elementName, String attributeName, String attributeType,
    String[] enums, short attributeUse, String defaultValue )
        throws SAXException {

    boolean required = attributeUse==USE_REQUIRED;

    // get the attribute-property declaration
    BIElement edecl = bindInfo.element(elementName);
    BIAttribute decl=null;
    if(edecl!=null)     decl=edecl.attribute(attributeName);

    String propName;
    if(decl==null)  propName = model.getNameConverter().toPropertyName(attributeName);
    else            propName = decl.getPropertyName();

    QName qname = new QName("",attributeName);

    // if no declaration is specified, just wrap it by
    // a FieldItem and let the normalizer handle its content.
    TypeUse use;

    if(decl!=null && decl.getConversion()!=null)
        use = decl.getConversion().getTransducer();
    else
        use = builtinConversions.get(attributeType);

    CPropertyInfo r = new CAttributePropertyInfo(
        propName, null,null/*TODO*/, copyLocator(), qname, use, null, required );

    if(defaultValue!=null)
        r.defaultValue = CDefaultValue.create( use, new XmlString(defaultValue) );

    return r;
}
 
Example #23
Source File: TDTDReader.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected CPropertyInfo createAttribute(
    String elementName, String attributeName, String attributeType,
    String[] enums, short attributeUse, String defaultValue )
        throws SAXException {

    boolean required = attributeUse==USE_REQUIRED;

    // get the attribute-property declaration
    BIElement edecl = bindInfo.element(elementName);
    BIAttribute decl=null;
    if(edecl!=null)     decl=edecl.attribute(attributeName);

    String propName;
    if(decl==null)  propName = model.getNameConverter().toPropertyName(attributeName);
    else            propName = decl.getPropertyName();

    QName qname = new QName("",attributeName);

    // if no declaration is specified, just wrap it by
    // a FieldItem and let the normalizer handle its content.
    TypeUse use;

    if(decl!=null && decl.getConversion()!=null)
        use = decl.getConversion().getTransducer();
    else
        use = builtinConversions.get(attributeType);

    CPropertyInfo r = new CAttributePropertyInfo(
        propName, null,null/*TODO*/, copyLocator(), qname, use, null, required );

    if(defaultValue!=null)
        r.defaultValue = CDefaultValue.create( use, new XmlString(defaultValue) );

    return r;
}
 
Example #24
Source File: TDTDReader.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected CPropertyInfo createAttribute(
    String elementName, String attributeName, String attributeType,
    String[] enums, short attributeUse, String defaultValue )
        throws SAXException {

    boolean required = attributeUse==USE_REQUIRED;

    // get the attribute-property declaration
    BIElement edecl = bindInfo.element(elementName);
    BIAttribute decl=null;
    if(edecl!=null)     decl=edecl.attribute(attributeName);

    String propName;
    if(decl==null)  propName = model.getNameConverter().toPropertyName(attributeName);
    else            propName = decl.getPropertyName();

    QName qname = new QName("",attributeName);

    // if no declaration is specified, just wrap it by
    // a FieldItem and let the normalizer handle its content.
    TypeUse use;

    if(decl!=null && decl.getConversion()!=null)
        use = decl.getConversion().getTransducer();
    else
        use = builtinConversions.get(attributeType);

    CPropertyInfo r = new CAttributePropertyInfo(
        propName, null,null/*TODO*/, copyLocator(), qname, use, null, required );

    if(defaultValue!=null)
        r.defaultValue = CDefaultValue.create( use, new XmlString(defaultValue) );

    return r;
}