Java Code Examples for com.sun.xml.internal.bind.v2.runtime.property.AttributeProperty

The following examples show how to use com.sun.xml.internal.bind.v2.runtime.property.AttributeProperty. These examples are extracted from open source projects. 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
/**
 * Completes the initialization.
 *
 * <p>
 * To fix the cyclic reference issue, the main part of the initialization needs to be done
 * after a {@link StructureLoader} is set to {@link ClassBeanInfoImpl#loader}.
 */
public void init( JAXBContextImpl context, ClassBeanInfoImpl beanInfo, Accessor<?,Map<QName,String>> attWildcard) {
    UnmarshallerChain chain = new UnmarshallerChain(context);
    for (ClassBeanInfoImpl bi = beanInfo; bi != null; bi = bi.superClazz) {
        for (int i = bi.properties.length - 1; i >= 0; i--) {
            Property p = bi.properties[i];

            switch(p.getKind()) {
            case ATTRIBUTE:
                if(attUnmarshallers==null)
                    attUnmarshallers = new QNameMap<TransducedAccessor>();
                AttributeProperty ap = (AttributeProperty) p;
                attUnmarshallers.put(ap.attName.toQName(),ap.xacc);
                break;
            case ELEMENT:
            case REFERENCE:
            case MAP:
            case VALUE:
                p.buildChildElementUnmarshallers(chain,childUnmarshallers);
                break;
            }
        }
    }

    this.frameSize = chain.getScopeSize();

    textHandler = childUnmarshallers.get(StructureLoaderBuilder.TEXT_HANDLER);
    catchAll = childUnmarshallers.get(StructureLoaderBuilder.CATCH_ALL);

    if(attWildcard!=null) {
        attCatchAll = (Accessor<Object,Map<QName,String>>) attWildcard;
        // we use attUnmarshallers==null as a sign to skip the attribute processing
        // altogether, so if we have an att wildcard we need to have an empty qname map.
        if(attUnmarshallers==null)
            attUnmarshallers = EMPTY;
    } else {
        attCatchAll = null;
    }
}
 
Example 2
Source Project: jdk8u60   Source File: StructureLoader.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Completes the initialization.
 *
 * <p>
 * To fix the cyclic reference issue, the main part of the initialization needs to be done
 * after a {@link StructureLoader} is set to {@link ClassBeanInfoImpl#loader}.
 */
public void init( JAXBContextImpl context, ClassBeanInfoImpl beanInfo, Accessor<?,Map<QName,String>> attWildcard) {
    UnmarshallerChain chain = new UnmarshallerChain(context);
    for (ClassBeanInfoImpl bi = beanInfo; bi != null; bi = bi.superClazz) {
        for (int i = bi.properties.length - 1; i >= 0; i--) {
            Property p = bi.properties[i];

            switch(p.getKind()) {
            case ATTRIBUTE:
                if(attUnmarshallers==null)
                    attUnmarshallers = new QNameMap<TransducedAccessor>();
                AttributeProperty ap = (AttributeProperty) p;
                attUnmarshallers.put(ap.attName.toQName(),ap.xacc);
                break;
            case ELEMENT:
            case REFERENCE:
            case MAP:
            case VALUE:
                p.buildChildElementUnmarshallers(chain,childUnmarshallers);
                break;
            }
        }
    }

    this.frameSize = chain.getScopeSize();

    textHandler = childUnmarshallers.get(StructureLoaderBuilder.TEXT_HANDLER);
    catchAll = childUnmarshallers.get(StructureLoaderBuilder.CATCH_ALL);

    if(attWildcard!=null) {
        attCatchAll = (Accessor<Object,Map<QName,String>>) attWildcard;
        // we use attUnmarshallers==null as a sign to skip the attribute processing
        // altogether, so if we have an att wildcard we need to have an empty qname map.
        if(attUnmarshallers==null)
            attUnmarshallers = EMPTY;
    } else {
        attCatchAll = null;
    }
}
 
Example 3
/**
 * Completes the initialization.
 *
 * <p>
 * To fix the cyclic reference issue, the main part of the initialization needs to be done
 * after a {@link StructureLoader} is set to {@link ClassBeanInfoImpl#loader}.
 */
public void init( JAXBContextImpl context, ClassBeanInfoImpl beanInfo, Accessor<?,Map<QName,String>> attWildcard) {
    UnmarshallerChain chain = new UnmarshallerChain(context);
    for (ClassBeanInfoImpl bi = beanInfo; bi != null; bi = bi.superClazz) {
        for (int i = bi.properties.length - 1; i >= 0; i--) {
            Property p = bi.properties[i];

            switch(p.getKind()) {
            case ATTRIBUTE:
                if(attUnmarshallers==null)
                    attUnmarshallers = new QNameMap<TransducedAccessor>();
                AttributeProperty ap = (AttributeProperty) p;
                attUnmarshallers.put(ap.attName.toQName(),ap.xacc);
                break;
            case ELEMENT:
            case REFERENCE:
            case MAP:
            case VALUE:
                p.buildChildElementUnmarshallers(chain,childUnmarshallers);
                break;
            }
        }
    }

    this.frameSize = chain.getScopeSize();

    textHandler = childUnmarshallers.get(StructureLoaderBuilder.TEXT_HANDLER);
    catchAll = childUnmarshallers.get(StructureLoaderBuilder.CATCH_ALL);

    if(attWildcard!=null) {
        attCatchAll = (Accessor<Object,Map<QName,String>>) attWildcard;
        // we use attUnmarshallers==null as a sign to skip the attribute processing
        // altogether, so if we have an att wildcard we need to have an empty qname map.
        if(attUnmarshallers==null)
            attUnmarshallers = EMPTY;
    } else {
        attCatchAll = null;
    }
}
 
Example 4
/**
 * Completes the initialization.
 *
 * <p>
 * To fix the cyclic reference issue, the main part of the initialization needs to be done
 * after a {@link StructureLoader} is set to {@link ClassBeanInfoImpl#loader}.
 */
public void init( JAXBContextImpl context, ClassBeanInfoImpl beanInfo, Accessor<?,Map<QName,String>> attWildcard) {
    UnmarshallerChain chain = new UnmarshallerChain(context);
    for (ClassBeanInfoImpl bi = beanInfo; bi != null; bi = bi.superClazz) {
        for (int i = bi.properties.length - 1; i >= 0; i--) {
            Property p = bi.properties[i];

            switch(p.getKind()) {
            case ATTRIBUTE:
                if(attUnmarshallers==null)
                    attUnmarshallers = new QNameMap<TransducedAccessor>();
                AttributeProperty ap = (AttributeProperty) p;
                attUnmarshallers.put(ap.attName.toQName(),ap.xacc);
                break;
            case ELEMENT:
            case REFERENCE:
            case MAP:
            case VALUE:
                p.buildChildElementUnmarshallers(chain,childUnmarshallers);
                break;
            }
        }
    }

    this.frameSize = chain.getScopeSize();

    textHandler = childUnmarshallers.get(StructureLoaderBuilder.TEXT_HANDLER);
    catchAll = childUnmarshallers.get(StructureLoaderBuilder.CATCH_ALL);

    if(attWildcard!=null) {
        attCatchAll = (Accessor<Object,Map<QName,String>>) attWildcard;
        // we use attUnmarshallers==null as a sign to skip the attribute processing
        // altogether, so if we have an att wildcard we need to have an empty qname map.
        if(attUnmarshallers==null)
            attUnmarshallers = EMPTY;
    } else {
        attCatchAll = null;
    }
}
 
Example 5
Source Project: openjdk-jdk9   Source File: StructureLoader.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Completes the initialization.
 *
 * <p>
 * To fix the cyclic reference issue, the main part of the initialization needs to be done
 * after a {@link StructureLoader} is set to {@link ClassBeanInfoImpl#loader}.
 */
public void init( JAXBContextImpl context, ClassBeanInfoImpl beanInfo, Accessor<?,Map<QName,String>> attWildcard) {
    UnmarshallerChain chain = new UnmarshallerChain(context);
    for (ClassBeanInfoImpl bi = beanInfo; bi != null; bi = bi.superClazz) {
        for (int i = bi.properties.length - 1; i >= 0; i--) {
            Property p = bi.properties[i];

            switch(p.getKind()) {
            case ATTRIBUTE:
                if(attUnmarshallers==null)
                    attUnmarshallers = new QNameMap<TransducedAccessor>();
                AttributeProperty ap = (AttributeProperty) p;
                attUnmarshallers.put(ap.attName.toQName(),ap.xacc);
                break;
            case ELEMENT:
            case REFERENCE:
            case MAP:
            case VALUE:
                p.buildChildElementUnmarshallers(chain,childUnmarshallers);
                break;
            }
        }
    }

    this.frameSize = chain.getScopeSize();

    textHandler = childUnmarshallers.get(StructureLoaderBuilder.TEXT_HANDLER);
    catchAll = childUnmarshallers.get(StructureLoaderBuilder.CATCH_ALL);

    if(attWildcard!=null) {
        attCatchAll = (Accessor<Object,Map<QName,String>>) attWildcard;
        // we use attUnmarshallers==null as a sign to skip the attribute processing
        // altogether, so if we have an att wildcard we need to have an empty qname map.
        if(attUnmarshallers==null)
            attUnmarshallers = EMPTY;
    } else {
        attCatchAll = null;
    }
}
 
Example 6
Source Project: hottub   Source File: StructureLoader.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Completes the initialization.
 *
 * <p>
 * To fix the cyclic reference issue, the main part of the initialization needs to be done
 * after a {@link StructureLoader} is set to {@link ClassBeanInfoImpl#loader}.
 */
public void init( JAXBContextImpl context, ClassBeanInfoImpl beanInfo, Accessor<?,Map<QName,String>> attWildcard) {
    UnmarshallerChain chain = new UnmarshallerChain(context);
    for (ClassBeanInfoImpl bi = beanInfo; bi != null; bi = bi.superClazz) {
        for (int i = bi.properties.length - 1; i >= 0; i--) {
            Property p = bi.properties[i];

            switch(p.getKind()) {
            case ATTRIBUTE:
                if(attUnmarshallers==null)
                    attUnmarshallers = new QNameMap<TransducedAccessor>();
                AttributeProperty ap = (AttributeProperty) p;
                attUnmarshallers.put(ap.attName.toQName(),ap.xacc);
                break;
            case ELEMENT:
            case REFERENCE:
            case MAP:
            case VALUE:
                p.buildChildElementUnmarshallers(chain,childUnmarshallers);
                break;
            }
        }
    }

    this.frameSize = chain.getScopeSize();

    textHandler = childUnmarshallers.get(StructureLoaderBuilder.TEXT_HANDLER);
    catchAll = childUnmarshallers.get(StructureLoaderBuilder.CATCH_ALL);

    if(attWildcard!=null) {
        attCatchAll = (Accessor<Object,Map<QName,String>>) attWildcard;
        // we use attUnmarshallers==null as a sign to skip the attribute processing
        // altogether, so if we have an att wildcard we need to have an empty qname map.
        if(attUnmarshallers==null)
            attUnmarshallers = EMPTY;
    } else {
        attCatchAll = null;
    }
}
 
Example 7
/**
 * Completes the initialization.
 *
 * <p>
 * To fix the cyclic reference issue, the main part of the initialization needs to be done
 * after a {@link StructureLoader} is set to {@link ClassBeanInfoImpl#loader}.
 */
public void init( JAXBContextImpl context, ClassBeanInfoImpl beanInfo, Accessor<?,Map<QName,String>> attWildcard) {
    UnmarshallerChain chain = new UnmarshallerChain(context);
    for (ClassBeanInfoImpl bi = beanInfo; bi != null; bi = bi.superClazz) {
        for (int i = bi.properties.length - 1; i >= 0; i--) {
            Property p = bi.properties[i];

            switch(p.getKind()) {
            case ATTRIBUTE:
                if(attUnmarshallers==null)
                    attUnmarshallers = new QNameMap<TransducedAccessor>();
                AttributeProperty ap = (AttributeProperty) p;
                attUnmarshallers.put(ap.attName.toQName(),ap.xacc);
                break;
            case ELEMENT:
            case REFERENCE:
            case MAP:
            case VALUE:
                p.buildChildElementUnmarshallers(chain,childUnmarshallers);
                break;
            }
        }
    }

    this.frameSize = chain.getScopeSize();

    textHandler = childUnmarshallers.get(StructureLoaderBuilder.TEXT_HANDLER);
    catchAll = childUnmarshallers.get(StructureLoaderBuilder.CATCH_ALL);

    if(attWildcard!=null) {
        attCatchAll = (Accessor<Object,Map<QName,String>>) attWildcard;
        // we use attUnmarshallers==null as a sign to skip the attribute processing
        // altogether, so if we have an att wildcard we need to have an empty qname map.
        if(attUnmarshallers==null)
            attUnmarshallers = EMPTY;
    } else {
        attCatchAll = null;
    }
}
 
Example 8
Source Project: openjdk-8   Source File: StructureLoader.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Completes the initialization.
 *
 * <p>
 * To fix the cyclic reference issue, the main part of the initialization needs to be done
 * after a {@link StructureLoader} is set to {@link ClassBeanInfoImpl#loader}.
 */
public void init( JAXBContextImpl context, ClassBeanInfoImpl beanInfo, Accessor<?,Map<QName,String>> attWildcard) {
    UnmarshallerChain chain = new UnmarshallerChain(context);
    for (ClassBeanInfoImpl bi = beanInfo; bi != null; bi = bi.superClazz) {
        for (int i = bi.properties.length - 1; i >= 0; i--) {
            Property p = bi.properties[i];

            switch(p.getKind()) {
            case ATTRIBUTE:
                if(attUnmarshallers==null)
                    attUnmarshallers = new QNameMap<TransducedAccessor>();
                AttributeProperty ap = (AttributeProperty) p;
                attUnmarshallers.put(ap.attName.toQName(),ap.xacc);
                break;
            case ELEMENT:
            case REFERENCE:
            case MAP:
            case VALUE:
                p.buildChildElementUnmarshallers(chain,childUnmarshallers);
                break;
            }
        }
    }

    this.frameSize = chain.getScopeSize();

    textHandler = childUnmarshallers.get(StructureLoaderBuilder.TEXT_HANDLER);
    catchAll = childUnmarshallers.get(StructureLoaderBuilder.CATCH_ALL);

    if(attWildcard!=null) {
        attCatchAll = (Accessor<Object,Map<QName,String>>) attWildcard;
        // we use attUnmarshallers==null as a sign to skip the attribute processing
        // altogether, so if we have an att wildcard we need to have an empty qname map.
        if(attUnmarshallers==null)
            attUnmarshallers = EMPTY;
    } else {
        attCatchAll = null;
    }
}
 
Example 9
@Override
protected void link(JAXBContextImpl grammar) {
    if(uriProperties!=null)
        return; // avoid linking twice

    super.link(grammar);

    if(superClazz!=null)
        superClazz.link(grammar);

    getLoader(grammar,true);    // make sure to build the loader if we haven't done so.

    // propagate values from super class
    if(superClazz!=null) {
        if(idProperty==null)
            idProperty = superClazz.idProperty;

        if(!superClazz.hasElementOnlyContentModel())
            hasElementOnlyContentModel(false);
    }

    // create a list of attribute/URI handlers
    List<AttributeProperty> attProps = new FinalArrayList<AttributeProperty>();
    List<Property> uriProps = new FinalArrayList<Property>();
    for (ClassBeanInfoImpl bi = this; bi != null; bi = bi.superClazz) {
        for (int i = 0; i < bi.properties.length; i++) {
            Property p = bi.properties[i];
            if(p instanceof AttributeProperty)
                attProps.add((AttributeProperty) p);
            if(p.hasSerializeURIAction())
                uriProps.add(p);
        }
    }
    if(grammar.c14nSupport)
        Collections.sort(attProps);

    if(attProps.isEmpty())
        attributeProperties = EMPTY_PROPERTIES;
    else
        attributeProperties = attProps.toArray(new AttributeProperty[attProps.size()]);

    if(uriProps.isEmpty())
        uriProperties = EMPTY_PROPERTIES;
    else
        uriProperties = uriProps.toArray(new Property[uriProps.size()]);
}
 
Example 10
Source Project: jdk8u60   Source File: ClassBeanInfoImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void link(JAXBContextImpl grammar) {
    if(uriProperties!=null)
        return; // avoid linking twice

    super.link(grammar);

    if(superClazz!=null)
        superClazz.link(grammar);

    getLoader(grammar,true);    // make sure to build the loader if we haven't done so.

    // propagate values from super class
    if(superClazz!=null) {
        if(idProperty==null)
            idProperty = superClazz.idProperty;

        if(!superClazz.hasElementOnlyContentModel())
            hasElementOnlyContentModel(false);
    }

    // create a list of attribute/URI handlers
    List<AttributeProperty> attProps = new FinalArrayList<AttributeProperty>();
    List<Property> uriProps = new FinalArrayList<Property>();
    for (ClassBeanInfoImpl bi = this; bi != null; bi = bi.superClazz) {
        for (int i = 0; i < bi.properties.length; i++) {
            Property p = bi.properties[i];
            if(p instanceof AttributeProperty)
                attProps.add((AttributeProperty) p);
            if(p.hasSerializeURIAction())
                uriProps.add(p);
        }
    }
    if(grammar.c14nSupport)
        Collections.sort(attProps);

    if(attProps.isEmpty())
        attributeProperties = EMPTY_PROPERTIES;
    else
        attributeProperties = attProps.toArray(new AttributeProperty[attProps.size()]);

    if(uriProps.isEmpty())
        uriProperties = EMPTY_PROPERTIES;
    else
        uriProperties = uriProps.toArray(new Property[uriProps.size()]);
}
 
Example 11
@Override
protected void link(JAXBContextImpl grammar) {
    if(uriProperties!=null)
        return; // avoid linking twice

    super.link(grammar);

    if(superClazz!=null)
        superClazz.link(grammar);

    getLoader(grammar,true);    // make sure to build the loader if we haven't done so.

    // propagate values from super class
    if(superClazz!=null) {
        if(idProperty==null)
            idProperty = superClazz.idProperty;

        if(!superClazz.hasElementOnlyContentModel())
            hasElementOnlyContentModel(false);
    }

    // create a list of attribute/URI handlers
    List<AttributeProperty> attProps = new FinalArrayList<AttributeProperty>();
    List<Property> uriProps = new FinalArrayList<Property>();
    for (ClassBeanInfoImpl bi = this; bi != null; bi = bi.superClazz) {
        for (int i = 0; i < bi.properties.length; i++) {
            Property p = bi.properties[i];
            if(p instanceof AttributeProperty)
                attProps.add((AttributeProperty) p);
            if(p.hasSerializeURIAction())
                uriProps.add(p);
        }
    }
    if(grammar.c14nSupport)
        Collections.sort(attProps);

    if(attProps.isEmpty())
        attributeProperties = EMPTY_PROPERTIES;
    else
        attributeProperties = attProps.toArray(new AttributeProperty[attProps.size()]);

    if(uriProps.isEmpty())
        uriProperties = EMPTY_PROPERTIES;
    else
        uriProperties = uriProps.toArray(new Property[uriProps.size()]);
}
 
Example 12
@Override
protected void link(JAXBContextImpl grammar) {
    if(uriProperties!=null)
        return; // avoid linking twice

    super.link(grammar);

    if(superClazz!=null)
        superClazz.link(grammar);

    getLoader(grammar,true);    // make sure to build the loader if we haven't done so.

    // propagate values from super class
    if(superClazz!=null) {
        if(idProperty==null)
            idProperty = superClazz.idProperty;

        if(!superClazz.hasElementOnlyContentModel())
            hasElementOnlyContentModel(false);
    }

    // create a list of attribute/URI handlers
    List<AttributeProperty> attProps = new FinalArrayList<AttributeProperty>();
    List<Property> uriProps = new FinalArrayList<Property>();
    for (ClassBeanInfoImpl bi = this; bi != null; bi = bi.superClazz) {
        for (int i = 0; i < bi.properties.length; i++) {
            Property p = bi.properties[i];
            if(p instanceof AttributeProperty)
                attProps.add((AttributeProperty) p);
            if(p.hasSerializeURIAction())
                uriProps.add(p);
        }
    }
    if(grammar.c14nSupport)
        Collections.sort(attProps);

    if(attProps.isEmpty())
        attributeProperties = EMPTY_PROPERTIES;
    else
        attributeProperties = attProps.toArray(new AttributeProperty[attProps.size()]);

    if(uriProps.isEmpty())
        uriProperties = EMPTY_PROPERTIES;
    else
        uriProperties = uriProps.toArray(new Property[uriProps.size()]);
}
 
Example 13
@Override
protected void link(JAXBContextImpl grammar) {
    if(uriProperties!=null)
        return; // avoid linking twice

    super.link(grammar);

    if(superClazz!=null)
        superClazz.link(grammar);

    getLoader(grammar,true);    // make sure to build the loader if we haven't done so.

    // propagate values from super class
    if(superClazz!=null) {
        if(idProperty==null)
            idProperty = superClazz.idProperty;

        if(!superClazz.hasElementOnlyContentModel())
            hasElementOnlyContentModel(false);
    }

    // create a list of attribute/URI handlers
    List<AttributeProperty> attProps = new FinalArrayList<AttributeProperty>();
    List<Property> uriProps = new FinalArrayList<Property>();
    for (ClassBeanInfoImpl bi = this; bi != null; bi = bi.superClazz) {
        for (int i = 0; i < bi.properties.length; i++) {
            Property p = bi.properties[i];
            if(p instanceof AttributeProperty)
                attProps.add((AttributeProperty) p);
            if(p.hasSerializeURIAction())
                uriProps.add(p);
        }
    }
    if(grammar.c14nSupport)
        Collections.sort(attProps);

    if(attProps.isEmpty())
        attributeProperties = EMPTY_PROPERTIES;
    else
        attributeProperties = attProps.toArray(new AttributeProperty[attProps.size()]);

    if(uriProps.isEmpty())
        uriProperties = EMPTY_PROPERTIES;
    else
        uriProperties = uriProps.toArray(new Property[uriProps.size()]);
}
 
Example 14
Source Project: hottub   Source File: ClassBeanInfoImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void link(JAXBContextImpl grammar) {
    if(uriProperties!=null)
        return; // avoid linking twice

    super.link(grammar);

    if(superClazz!=null)
        superClazz.link(grammar);

    getLoader(grammar,true);    // make sure to build the loader if we haven't done so.

    // propagate values from super class
    if(superClazz!=null) {
        if(idProperty==null)
            idProperty = superClazz.idProperty;

        if(!superClazz.hasElementOnlyContentModel())
            hasElementOnlyContentModel(false);
    }

    // create a list of attribute/URI handlers
    List<AttributeProperty> attProps = new FinalArrayList<AttributeProperty>();
    List<Property> uriProps = new FinalArrayList<Property>();
    for (ClassBeanInfoImpl bi = this; bi != null; bi = bi.superClazz) {
        for (int i = 0; i < bi.properties.length; i++) {
            Property p = bi.properties[i];
            if(p instanceof AttributeProperty)
                attProps.add((AttributeProperty) p);
            if(p.hasSerializeURIAction())
                uriProps.add(p);
        }
    }
    if(grammar.c14nSupport)
        Collections.sort(attProps);

    if(attProps.isEmpty())
        attributeProperties = EMPTY_PROPERTIES;
    else
        attributeProperties = attProps.toArray(new AttributeProperty[attProps.size()]);

    if(uriProps.isEmpty())
        uriProperties = EMPTY_PROPERTIES;
    else
        uriProperties = uriProps.toArray(new Property[uriProps.size()]);
}
 
Example 15
@Override
protected void link(JAXBContextImpl grammar) {
    if(uriProperties!=null)
        return; // avoid linking twice

    super.link(grammar);

    if(superClazz!=null)
        superClazz.link(grammar);

    getLoader(grammar,true);    // make sure to build the loader if we haven't done so.

    // propagate values from super class
    if(superClazz!=null) {
        if(idProperty==null)
            idProperty = superClazz.idProperty;

        if(!superClazz.hasElementOnlyContentModel())
            hasElementOnlyContentModel(false);
    }

    // create a list of attribute/URI handlers
    List<AttributeProperty> attProps = new FinalArrayList<AttributeProperty>();
    List<Property> uriProps = new FinalArrayList<Property>();
    for (ClassBeanInfoImpl bi = this; bi != null; bi = bi.superClazz) {
        for (int i = 0; i < bi.properties.length; i++) {
            Property p = bi.properties[i];
            if(p instanceof AttributeProperty)
                attProps.add((AttributeProperty) p);
            if(p.hasSerializeURIAction())
                uriProps.add(p);
        }
    }
    if(grammar.c14nSupport)
        Collections.sort(attProps);

    if(attProps.isEmpty())
        attributeProperties = EMPTY_PROPERTIES;
    else
        attributeProperties = attProps.toArray(new AttributeProperty[attProps.size()]);

    if(uriProps.isEmpty())
        uriProperties = EMPTY_PROPERTIES;
    else
        uriProperties = uriProps.toArray(new Property[uriProps.size()]);
}
 
Example 16
Source Project: openjdk-8   Source File: ClassBeanInfoImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void link(JAXBContextImpl grammar) {
    if(uriProperties!=null)
        return; // avoid linking twice

    super.link(grammar);

    if(superClazz!=null)
        superClazz.link(grammar);

    getLoader(grammar,true);    // make sure to build the loader if we haven't done so.

    // propagate values from super class
    if(superClazz!=null) {
        if(idProperty==null)
            idProperty = superClazz.idProperty;

        if(!superClazz.hasElementOnlyContentModel())
            hasElementOnlyContentModel(false);
    }

    // create a list of attribute/URI handlers
    List<AttributeProperty> attProps = new FinalArrayList<AttributeProperty>();
    List<Property> uriProps = new FinalArrayList<Property>();
    for (ClassBeanInfoImpl bi = this; bi != null; bi = bi.superClazz) {
        for (int i = 0; i < bi.properties.length; i++) {
            Property p = bi.properties[i];
            if(p instanceof AttributeProperty)
                attProps.add((AttributeProperty) p);
            if(p.hasSerializeURIAction())
                uriProps.add(p);
        }
    }
    if(grammar.c14nSupport)
        Collections.sort(attProps);

    if(attProps.isEmpty())
        attributeProperties = EMPTY_PROPERTIES;
    else
        attributeProperties = attProps.toArray(new AttributeProperty[attProps.size()]);

    if(uriProps.isEmpty())
        uriProperties = EMPTY_PROPERTIES;
    else
        uriProperties = uriProps.toArray(new Property[uriProps.size()]);
}