325N/A * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. 325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 325N/A * This code is free software; you can redistribute it and/or modify it 325N/A * under the terms of the GNU General Public License version 2 only, as 325N/A * published by the Free Software Foundation. Oracle designates this 325N/A * particular file as subject to the "Classpath" exception as provided 325N/A * by Oracle in the LICENSE file that accompanied this code. 325N/A * This code is distributed in the hope that it will be useful, but WITHOUT 325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 325N/A * version 2 for more details (a copy is included in the LICENSE file that 325N/A * accompanied this code). 325N/A * You should have received a copy of the GNU General Public License version 325N/A * 2 along with this work; if not, write to the Free Software Foundation, 325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 325N/A * or visit www.oracle.com if you need additional information or have any 325N/A * <p>JAXB representation of an Xml Element.</p> 325N/A * <p>This class represents information about an Xml Element from both the element 325N/A * declaration within a schema and the element instance value within an xml document 325N/A * with the following properties 325N/A * <li>element's xml tag <b><tt>name</tt></b></li> 325N/A * <li><b><tt>value</tt></b> represents the element instance's atttribute(s) and content model</li> 325N/A * <li>element declaration's <b><tt>declaredType</tt></b> (<tt>xs:element @type</tt> attribute)</li> 325N/A * <li><b><tt>scope</tt></b> of element declaration</li> 325N/A * <li>boolean <b><tt>nil</tt></b> property. (element instance's <tt><b>xsi:nil</b></tt> attribute)</li> 325N/A * <p>The <tt>declaredType</tt> and <tt>scope</tt> property are the 325N/A * JAXB class binding for the xml type definition. 325N/A * <p><b><tt>Scope</tt></b> is either {@link GlobalScope} or the Java class representing the 325N/A * complex type definition containing the schema element declaration. 325N/A * <p>There is a property constraint that if <b><tt>value</tt></b> is <tt>null</tt>, 325N/A * then <tt>nil</tt> must be <tt>true</tt>. The converse is not true to enable 325N/A * representing a nil element with attribute(s). If <tt>nil</tt> is true, it is possible 325N/A * that <tt>value</tt> is non-null so it can hold the value of the attributes 325N/A * associated with a nil element. 325N/A * @author Kohsuke Kawaguchi, Joe Fialli 325N/A /** xml element tag name */ 325N/A /** Java datatype binding for xml element declaration's type. */ 325N/A /** Scope of xml element declaration representing this xml element instance. 325N/A * Can be one of the following values: 325N/A * - {@link GlobalScope} for global xml element declaration. 325N/A * - local element declaration has a scope set to the Java class 325N/A * representation of complex type defintion containing 325N/A * xml element declaration. 325N/A Represents content model and attributes of an xml element instance. */ 325N/A /** true iff the xml element instance has xsi:nil="true". */ 325N/A * Designates global scope for an xml element. 325N/A * <p>Construct an xml element instance.</p> 325N/A * @param name Java binding of xml element tag name 325N/A * @param declaredType Java binding of xml element declaration's type 325N/A * Java binding of scope of xml element declaration. 325N/A * Passing null is the same as passing <tt>GlobalScope.class</tt> 325N/A * Java instance representing xml element's value. 325N/A * @see #isTypeSubstituted() 325N/A * Construct an xml element instance. 325N/A * This is just a convenience method for <tt>new JAXBElement(name,declaredType,GlobalScope.class,value)</tt> 325N/A * Returns the Java binding of the xml element declaration's type attribute. 325N/A * Returns the xml element tag name. 325N/A * <p>Set the content model and attributes of this xml element.</p> 325N/A * <p>When this property is set to <tt>null</tt>, <tt>isNil()</tt> must by <tt>true</tt>. 325N/A * Details of constraint are described at {@link #isNil()}.</p> 325N/A * @see #isTypeSubstituted() 325N/A * <p>Return the content model and attribute values for this element.</p> 325N/A * <p>See {@link #isNil()} for a description of a property constraint when 325N/A * this value is <tt>null</tt></p> 325N/A * Returns scope of xml element declaration. 325N/A * @see #isGlobalScope() 325N/A * @return <tt>GlobalScope.class</tt> if this element is of global scope. 325N/A * <p>Returns <tt>true</tt> iff this element instance content model 325N/A * <p>This property always returns <tt>true</tt> when {@link #getValue()} is null. 325N/A * Note that the converse is not true, when this property is <tt>true</tt>, 325N/A * {@link #getValue()} can contain a non-null value for attribute(s). It is 325N/A * valid for a nil xml element to have attribute(s).</p> 325N/A * <p>Set whether this element has nil content.</p> 325N/A * (Not necessary but they do unambiguously conceptualize 325N/A * the rationale behind this class' fields.) 325N/A * Returns true iff this xml element declaration is global. 325N/A * Returns true iff this xml element instance's value has a different 325N/A * type than xml element declaration's declared type.