Java Code Examples for com.sun.xml.internal.bind.v2.model.core.PropertyKind

The following examples show how to use com.sun.xml.internal.bind.v2.model.core.PropertyKind. 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
public PropertyKind kind() {
    return PropertyKind.REFERENCE;
}
 
Example 2
public final PropertyKind kind() {
    return PropertyKind.MAP;
}
 
Example 3
public final PropertyKind kind() {
    return PropertyKind.ATTRIBUTE;
}
 
Example 4
Source Project: TencentKona-8   Source File: ClassInfoImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
public final boolean isSimpleType() {
    List<? extends PropertyInfo> props = getProperties();
    if(props.size()!=1)     return false;
    return props.get(0).kind()==PropertyKind.VALUE;
}
 
Example 5
public PropertyKind getKind() {
    return PropertyKind.ATTRIBUTE;
}
 
Example 6
public final PropertyKind kind() {
    return PropertyKind.ELEMENT;
}
 
Example 7
public PropertyKind getKind() {
    return PropertyKind.MAP;
}
 
Example 8
public final PropertyKind getKind() {
    return PropertyKind.ELEMENT;
}
 
Example 9
public final PropertyKind kind() {
    return PropertyKind.ATTRIBUTE;
}
 
Example 10
Source Project: TencentKona-8   Source File: ValueProperty.java    License: GNU General Public License v2.0 4 votes vote down vote up
public PropertyKind getKind() {
    return PropertyKind.VALUE;
}
 
Example 11
public PropertyKind getKind() {
    return PropertyKind.ATTRIBUTE;
}
 
Example 12
public PropertyKind getKind() {
    return PropertyKind.ELEMENT;
}
 
Example 13
Source Project: openjdk-8   Source File: ElementInfoImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
public PropertyKind kind() {
    return PropertyKind.ELEMENT;
}
 
Example 14
public PropertyKind getKind() {
    return PropertyKind.REFERENCE;
}
 
Example 15
/**
 * The constructor for the sole instanceof {@link JaxBeanInfo} for
 * handling user-created {@link JAXBElement}.
 *
 * Such {@link JaxBeanInfo} is used only for marshalling.
 *
 * This is a hack.
 */
protected ElementBeanInfoImpl(final JAXBContextImpl grammar) {
    super(grammar,null,JAXBElement.class,true,false,true);
    tagName = null;
    expectedType = null;
    scope = null;
    constructor = null;

    this.property = new Property<JAXBElement>() {
        public void reset(JAXBElement o) {
            throw new UnsupportedOperationException();
        }

        public void serializeBody(JAXBElement e, XMLSerializer target, Object outerPeer) throws SAXException, IOException, XMLStreamException {
            Class scope = e.getScope();
            if(e.isGlobalScope())   scope = null;
            QName n = e.getName();
            ElementBeanInfoImpl bi = grammar.getElement(scope,n);
            if(bi==null) {
                // infer what to do from the type
                JaxBeanInfo tbi;
                try {
                    tbi = grammar.getBeanInfo(e.getDeclaredType(),true);
                } catch (JAXBException x) {
                    // if e.getDeclaredType() isn't known to this JAXBContext
                    target.reportError(null,x);
                    return;
                }
                Object value = e.getValue();
                target.startElement(n.getNamespaceURI(),n.getLocalPart(),n.getPrefix(),null);
                if(value==null) {
                    target.writeXsiNilTrue();
                } else {
                    target.childAsXsiType(value,"value",tbi, false);
                }
                target.endElement();
            } else {
                try {
                    bi.property.serializeBody(e,target,e);
                } catch (AccessorException x) {
                    target.reportError(null,x);
                }
            }
        }

        public void serializeURIs(JAXBElement o, XMLSerializer target) {
        }

        public boolean hasSerializeURIAction() {
            return false;
        }

        public String getIdValue(JAXBElement o) {
            return null;
        }

        public PropertyKind getKind() {
            return PropertyKind.ELEMENT;
        }

        public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) {
        }

        public Accessor getElementPropertyAccessor(String nsUri, String localName) {
            throw new UnsupportedOperationException();
        }

        public void wrapUp() {
        }

        public RuntimePropertyInfo getInfo() {
            return property.getInfo();
        }

        public boolean isHiddenByOverride() {
            return false;
        }

        public void setHiddenByOverride(boolean hidden) {
            throw new UnsupportedOperationException("Not supported on jaxbelements.");
        }

        public String getFieldName() {
            return null;
        }

    };
}
 
Example 16
public final PropertyKind kind() {
    return PropertyKind.REFERENCE;
}
 
Example 17
public PropertyKind getKind() {
    return PropertyKind.REFERENCE;
}
 
Example 18
public final PropertyKind kind() {
    return PropertyKind.ELEMENT;
}
 
Example 19
public final PropertyKind kind() {
    return  PropertyKind.VALUE;
}
 
Example 20
public PropertyKind kind() {
    return PropertyKind.REFERENCE;
}
 
Example 21
/**
 * The constructor for the sole instanceof {@link JaxBeanInfo} for
 * handling user-created {@link JAXBElement}.
 *
 * Such {@link JaxBeanInfo} is used only for marshalling.
 *
 * This is a hack.
 */
protected ElementBeanInfoImpl(final JAXBContextImpl grammar) {
    super(grammar,null,JAXBElement.class,true,false,true);
    tagName = null;
    expectedType = null;
    scope = null;
    constructor = null;

    this.property = new Property<JAXBElement>() {
        public void reset(JAXBElement o) {
            throw new UnsupportedOperationException();
        }

        public void serializeBody(JAXBElement e, XMLSerializer target, Object outerPeer) throws SAXException, IOException, XMLStreamException {
            Class scope = e.getScope();
            if(e.isGlobalScope())   scope = null;
            QName n = e.getName();
            ElementBeanInfoImpl bi = grammar.getElement(scope,n);
            if(bi==null) {
                // infer what to do from the type
                JaxBeanInfo tbi;
                try {
                    tbi = grammar.getBeanInfo(e.getDeclaredType(),true);
                } catch (JAXBException x) {
                    // if e.getDeclaredType() isn't known to this JAXBContext
                    target.reportError(null,x);
                    return;
                }
                Object value = e.getValue();
                target.startElement(n.getNamespaceURI(),n.getLocalPart(),n.getPrefix(),null);
                if(value==null) {
                    target.writeXsiNilTrue();
                } else {
                    target.childAsXsiType(value,"value",tbi, false);
                }
                target.endElement();
            } else {
                try {
                    bi.property.serializeBody(e,target,e);
                } catch (AccessorException x) {
                    target.reportError(null,x);
                }
            }
        }

        public void serializeURIs(JAXBElement o, XMLSerializer target) {
        }

        public boolean hasSerializeURIAction() {
            return false;
        }

        public String getIdValue(JAXBElement o) {
            return null;
        }

        public PropertyKind getKind() {
            return PropertyKind.ELEMENT;
        }

        public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) {
        }

        public Accessor getElementPropertyAccessor(String nsUri, String localName) {
            throw new UnsupportedOperationException();
        }

        public void wrapUp() {
        }

        public RuntimePropertyInfo getInfo() {
            return property.getInfo();
        }

        public boolean isHiddenByOverride() {
            return false;
        }

        public void setHiddenByOverride(boolean hidden) {
            throw new UnsupportedOperationException("Not supported on jaxbelements.");
        }

        public String getFieldName() {
            return null;
        }

    };
}
 
Example 22
public PropertyKind kind() {
    return PropertyKind.VALUE;
}
 
Example 23
Source Project: jdk8u60   Source File: ElementInfoImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
public PropertyKind kind() {
    return PropertyKind.ELEMENT;
}
 
Example 24
public PropertyKind getKind() {
    return PropertyKind.REFERENCE;
}
 
Example 25
Source Project: jdk8u60   Source File: ClassInfoImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
public final boolean isSimpleType() {
    List<? extends PropertyInfo> props = getProperties();
    if(props.size()!=1)     return false;
    return props.get(0).kind()==PropertyKind.VALUE;
}
 
Example 26
public final PropertyKind kind() {
    return PropertyKind.ELEMENT;
}
 
Example 27
public PropertyKind getKind() {
    return PropertyKind.ELEMENT;
}
 
Example 28
public PropertyKind getKind() {
    return PropertyKind.MAP;
}
 
Example 29
public PropertyKind kind() {
    return PropertyKind.VALUE;
}
 
Example 30
public PropertyKind getKind() {
    return PropertyKind.MAP;
}