Geen cache-versie.

Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code LNG204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.
javax.xml.bind

Class JAXBElement<T>

  • All Implemented Interfaces:
    Serializable

    public class JAXBElement<T>
    extends Object
    implements Serializable

    JAXB representation of an Xml Element.

    This class represents information about an Xml Element from both the element declaration within a schema and the element instance value within an xml document with the following properties

    • element's xml tag name
    • value represents the element instance's atttribute(s) and content model
    • element declaration's declaredType (xs:element @type attribute)
    • scope of element declaration
    • boolean nil property. (element instance's xsi:nil attribute)

    The declaredType and scope property are the JAXB class binding for the xml type definition.

    Scope is either JAXBElement.GlobalScope or the Java class representing the complex type definition containing the schema element declaration.

    There is a property constraint that if value is null, then nil must be true. The converse is not true to enable representing a nil element with attribute(s). If nil is true, it is possible that value is non-null so it can hold the value of the attributes associated with a nil element.

    Since:
    JAXB 2.0
    See Also:
    Serialized Form
    • Field Detail

      • name

        protected final QName name
        xml element tag name
      • declaredType

        protected final Class<T> declaredType
        Java datatype binding for xml element declaration's type.
      • scope

        protected final Class scope
        Scope of xml element declaration representing this xml element instance. Can be one of the following values: - JAXBElement.GlobalScope for global xml element declaration. - local element declaration has a scope set to the Java class representation of complex type defintion containing xml element declaration.
      • value

        protected T value
        xml element value. Represents content model and attributes of an xml element instance.
      • nil

        protected boolean nil
        true iff the xml element instance has xsi:nil="true".
    • Constructor Detail

      • JAXBElement

        public JAXBElement(QName name,
                   Class<T> declaredType,
                   Class scope,
                   T value)

        Construct an xml element instance.

        Parameters:
        name - Java binding of xml element tag name
        declaredType - Java binding of xml element declaration's type
        scope - Java binding of scope of xml element declaration. Passing null is the same as passing GlobalScope.class
        value - Java instance representing xml element's value.
        See Also:
        getScope(), isTypeSubstituted()
      • JAXBElement

        public JAXBElement(QName name,
                   Class<T> declaredType,
                   T value)
        Construct an xml element instance. This is just a convenience method for new JAXBElement(name,declaredType,GlobalScope.class,value)
    • Method Detail

      • getDeclaredType

        public Class<T> getDeclaredType()
        Returns the Java binding of the xml element declaration's type attribute.
      • getName

        public QName getName()
        Returns the xml element tag name.
      • setValue

        public void setValue(T t)

        Set the content model and attributes of this xml element.

        When this property is set to null, isNil() must by true. Details of constraint are described at isNil().

        See Also:
        isTypeSubstituted()
      • getValue

        public T getValue()

        Return the content model and attribute values for this element.

        See isNil() for a description of a property constraint when this value is null

      • getScope

        public Class getScope()
        Returns scope of xml element declaration.
        Returns:
        GlobalScope.class if this element is of global scope.
        See Also:
        isGlobalScope()
      • isNil

        public boolean isNil()

        Returns true iff this element instance content model is nil.

        This property always returns true when getValue() is null. Note that the converse is not true, when this property is true, getValue() can contain a non-null value for attribute(s). It is valid for a nil xml element to have attribute(s).

      • setNil

        public void setNil(boolean value)

        Set whether this element has nil content.

        See Also:
        isNil()
      • isGlobalScope

        public boolean isGlobalScope()
        Returns true iff this xml element declaration is global.
      • isTypeSubstituted

        public boolean isTypeSubstituted()
        Returns true iff this xml element instance's value has a different type than xml element declaration's declared type.

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-javax/xml/bind/JAXBElement.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut