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

The following examples show how to use com.sun.xml.internal.bind.v2.model.core.PropertyKind#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: SingleElementNodeProperty.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public PropertyKind getKind() {
    return PropertyKind.ELEMENT;
}
 
Example 2
Source File: ElementBeanInfoImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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 3
Source File: ListElementProperty.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public PropertyKind getKind() {
    return PropertyKind.ELEMENT;
}
 
Example 4
Source File: ElementBeanInfoImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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 5
Source File: ListElementProperty.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public PropertyKind getKind() {
    return PropertyKind.ELEMENT;
}
 
Example 6
Source File: ListElementProperty.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public PropertyKind getKind() {
    return PropertyKind.ELEMENT;
}
 
Example 7
Source File: ElementBeanInfoImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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 8
Source File: SingleElementNodeProperty.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public PropertyKind getKind() {
    return PropertyKind.ELEMENT;
}
 
Example 9
Source File: ListElementProperty.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public PropertyKind getKind() {
    return PropertyKind.ELEMENT;
}
 
Example 10
Source File: ArrayElementProperty.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public final PropertyKind getKind() {
    return PropertyKind.ELEMENT;
}
 
Example 11
Source File: ArrayElementProperty.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public final PropertyKind getKind() {
    return PropertyKind.ELEMENT;
}
 
Example 12
Source File: ElementPropertyInfoImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public final PropertyKind kind() {
    return PropertyKind.ELEMENT;
}
 
Example 13
Source File: CElementPropertyInfo.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public final PropertyKind kind() {
    return PropertyKind.ELEMENT;
}
 
Example 14
Source File: ElementInfoImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public PropertyKind kind() {
    return PropertyKind.ELEMENT;
}
 
Example 15
Source File: ElementBeanInfoImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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
Source File: ListElementProperty.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public PropertyKind getKind() {
    return PropertyKind.ELEMENT;
}
 
Example 17
Source File: SingleElementLeafProperty.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public PropertyKind getKind() {
    return PropertyKind.ELEMENT;
}
 
Example 18
Source File: SingleElementNodeProperty.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public PropertyKind getKind() {
    return PropertyKind.ELEMENT;
}
 
Example 19
Source File: SingleElementNodeProperty.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public PropertyKind getKind() {
    return PropertyKind.ELEMENT;
}
 
Example 20
Source File: ElementPropertyInfoImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public final PropertyKind kind() {
    return PropertyKind.ELEMENT;
}