SimpleValue (xmlbeans API)

org.apache.xmlbeans

## Interface SimpleValue

- All Superinterfaces:
    XmlObject, XmlTokenSource
  All Known Implementing Classes:
    AllDocumentImpl, AllImpl, AllImpl.MaxOccursImpl, AllImpl.MinOccursImpl, AllNNIImpl, AllNNIImpl.MemberImpl, AnnotatedImpl, AnnotationDocumentImpl, AnnotationDocumentImpl.AnnotationImpl, AnyAttributeDocumentImpl, AnyDocumentImpl, AnyDocumentImpl.AnyImpl, AppinfoDocumentImpl, AppinfoDocumentImpl.AppinfoImpl, AttributeDocumentImpl, AttributeGroupDocumentImpl, AttributeGroupImpl, AttributeGroupRefImpl, AttributeImpl, AttributeImpl.UseImpl, BaseAttributeImpl, BlockSetImpl, BlockSetImpl.MemberImpl, BlockSetImpl.MemberImpl2, BlockSetImpl.MemberImpl2.ItemImpl, ChoiceDocumentImpl, CodeImpl, ComplexContentDocumentImpl, ComplexContentDocumentImpl.ComplexContentImpl, ComplexRestrictionTypeImpl, ComplexTypeDocumentImpl, ComplexTypeImpl, ConfigDocumentImpl, ConfigDocumentImpl.ConfigImpl, DefinitionsDocumentImpl, DefinitionsDocumentImpl.DefinitionsImpl, DerivationControlImpl, DerivationSetImpl, DerivationSetImpl.MemberImpl, DerivationSetImpl.MemberImpl2, DocumentationDocumentImpl, DocumentationDocumentImpl.DocumentationImpl, DownloadedSchemaEntryImpl, DownloadedSchemasDocumentImpl, DownloadedSchemasDocumentImpl.DownloadedSchemasImpl, ElementDocumentImpl, ElementImpl, EnumerationDocumentImpl, ExplicitGroupImpl, ExtensionconfigImpl, ExtensionconfigImpl.InterfaceImpl, ExtensionconfigImpl.PrePostSetImpl, ExtensionTypeImpl, FacetImpl, FieldDocumentImpl, FieldDocumentImpl.FieldImpl, FieldDocumentImpl.FieldImpl.XpathImpl, FileDescImpl, FileDescImpl.RoleImpl, FilterXmlObject, FormChoiceImpl, FractionDigitsDocumentImpl, FullDerivationSetImpl, FullDerivationSetImpl.MemberImpl, FullDerivationSetImpl.MemberImpl2, GroupDocumentImpl, GroupImpl, GroupRefImpl, IdAttributeImpl, ImportDocumentImpl, ImportDocumentImpl.ImportImpl, IncludeDocumentImpl, IncludeDocumentImpl.IncludeImpl, JavaBase64Holder, JavaBase64HolderEx, JavaBooleanHolder, JavaBooleanHolderEx, JavaDecimalHolder, JavaDecimalHolderEx, JavaDoubleHolder, JavaDoubleHolderEx, JavaFloatHolder, JavaFloatHolderEx, JavaGDateHolderEx, JavaGDurationHolderEx, JavaHexBinaryHolder, JavaHexBinaryHolderEx, JavaIntegerHolder, JavaIntegerHolderEx, JavaIntHolder, JavaIntHolderEx, JavaLongHolder, JavaLongHolderEx, JavaNameImpl, JavaNameListImpl, JavaNameListImpl.MemberImpl, JavaNameListImpl.MemberImpl2, JavaNotationHolder, JavaNotationHolderEx, JavaQNameHolder, JavaQNameHolderEx, JavaStringEnumerationHolderEx, JavaStringHolder, JavaStringHolderEx, JavaUriHolder, JavaUriHolderEx, KeybaseImpl, KeyDocumentImpl, KeyrefDocumentImpl, KeyrefDocumentImpl.KeyrefImpl, LangAttributeImpl, LangAttributeImpl.LangImpl, LangAttributeImpl.LangImpl.MemberImpl, LengthDocumentImpl, ListDocumentImpl, ListDocumentImpl.ListImpl, LocalComplexTypeImpl, LocalElementImpl, LocalSimpleTypeImpl, MaxExclusiveDocumentImpl, MaxInclusiveDocumentImpl, MaxLengthDocumentImpl, MinExclusiveDocumentImpl, MinInclusiveDocumentImpl, MinLengthDocumentImpl, NamedAttributeGroupImpl, NamedGroupImpl, NamedGroupImpl.AllImpl, NamespaceListImpl, NamespaceListImpl, NamespaceListImpl.MemberImpl, NamespaceListImpl.MemberImpl, NamespaceListImpl.MemberImpl2, NamespaceListImpl.MemberImpl2, NamespaceListImpl.MemberImpl2.ItemImpl, NamespaceListImpl.MemberImpl2.ItemImpl, NamespaceListImpl.MemberImpl2.ItemImpl.MemberImpl, NamespaceListImpl.MemberImpl2.ItemImpl.MemberImpl, NamespacePrefixListImpl, NarrowMaxMinImpl, NarrowMaxMinImpl.MaxOccursImpl, NarrowMaxMinImpl.MinOccursImpl, NoFixedFacetImpl, NotationDocumentImpl, NotationDocumentImpl.NotationImpl, NsconfigImpl, NumFacetImpl, OpenAttrsImpl, PatternDocumentImpl, PatternDocumentImpl.PatternImpl, PublicImpl, QnameconfigImpl, QnametargetenumImpl, QnametargetlistImpl, RealGroupImpl, RedefineDocumentImpl, RedefineDocumentImpl.RedefineImpl, ReducedDerivationControlImpl, RestrictionDocumentImpl, RestrictionDocumentImpl.RestrictionImpl, RestrictionTypeImpl, SchemaDocumentImpl, SchemaDocumentImpl.SchemaImpl, SelectorDocumentImpl, SelectorDocumentImpl.SelectorImpl, SelectorDocumentImpl.SelectorImpl.XpathImpl, SequenceDocumentImpl, SimpleContentDocumentImpl, SimpleContentDocumentImpl.SimpleContentImpl, SimpleDerivationSetImpl, SimpleDerivationSetImpl.MemberImpl, SimpleDerivationSetImpl.MemberImpl2, SimpleDerivationSetImpl.MemberImpl2.ItemImpl, SimpleExplicitGroupImpl, SimpleExtensionTypeImpl, SimpleRestrictionTypeImpl, SimpleTypeDocumentImpl, SimpleTypeImpl, SpaceAttributeImpl, SpaceAttributeImpl.SpaceImpl, TestCaseImpl, TestCaseImpl.FilesImpl, TestsDocumentImpl, TestsDocumentImpl.TestsImpl, TImportImpl, TopLevelAttributeImpl, TopLevelComplexTypeImpl, TopLevelElementImpl, TopLevelSimpleTypeImpl, TotalDigitsDocumentImpl, TotalDigitsDocumentImpl.TotalDigitsImpl, TypeDerivationControlImpl, UnionDocumentImpl, UnionDocumentImpl.UnionImpl, UnionDocumentImpl.UnionImpl.MemberTypesImpl, UniqueDocumentImpl, UsertypeconfigImpl, WhiteSpaceDocumentImpl, WhiteSpaceDocumentImpl.WhiteSpaceImpl, WhiteSpaceDocumentImpl.WhiteSpaceImpl.ValueImpl, WildcardImpl, WildcardImpl.ProcessContentsImpl, XmlAnySimpleTypeImpl, XmlAnySimpleTypeRestriction, XmlAnyTypeImpl, XmlAnyUriImpl, XmlAnyUriRestriction, XmlBase64BinaryImpl, XmlBase64BinaryRestriction, XmlBooleanImpl, XmlBooleanRestriction, XmlByteImpl, XmlComplexContentImpl, XmlDateImpl, XmlDateTimeImpl, XmlDecimalImpl, XmlDecimalRestriction, XmlDoubleImpl, XmlDoubleRestriction, XmlDurationImpl, XmlEntitiesImpl, XmlEntityImpl, XmlFloatImpl, XmlFloatRestriction, XmlGDayImpl, XmlGMonthDayImpl, XmlGMonthImpl, XmlGYearImpl, XmlGYearMonthImpl, XmlHexBinaryImpl, XmlHexBinaryRestriction, XmlIdImpl, XmlIdRefImpl, XmlIdRefsImpl, XmlIntegerImpl, XmlIntegerRestriction, XmlIntImpl, XmlIntRestriction, XmlLanguageImpl, XmlListImpl, XmlLongImpl, XmlLongRestriction, XmlNameImpl, XmlNCNameImpl, XmlNegativeIntegerImpl, XmlNmTokenImpl, XmlNmTokensImpl, XmlNonNegativeIntegerImpl, XmlNonPositiveIntegerImpl, XmlNormalizedStringImpl, XmlNotationImpl, XmlNotationRestriction, XmlObjectBase, XmlPositiveIntegerImpl, XmlQNameImpl, XmlQNameRestriction, XmlShortImpl, XmlStringEnumeration, XmlStringImpl, XmlStringRestriction, XmlTimeImpl, XmlTokenImpl, XmlUnionImpl, XmlUnsignedByteImpl, XmlUnsignedIntImpl, XmlUnsignedLongImpl, XmlUnsignedShortImpl

      public interface SimpleValue
      extends XmlObject

  All XmlObject implementations can be coerced to SimpleValue. For any given schema type, only a subset of the conversion methods will work. Others will throw an exception.

  SimpleValue is useful for declaring variables which can hold more than one similar schema type that may not happen to have a common XML base type, for example, two list types, or two unrelated integer restrictions that happen to fit into an int.

- - ### Field Summary

    - ### Fields inherited from interface org.apache.xmlbeans.XmlObject

      `EQUAL, Factory, GREATER_THAN, LESS_THAN, NOT_EQUAL, type`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `BigDecimal` | `getBigDecimalValue()` Returns the value as a `BigDecimal`.
    `BigInteger` | `getBigIntegerValue()` Returns the value as a `BigInteger`.
    `boolean` | `getBooleanValue()` Returns the value as a boolean.
    `byte[]` | `getByteArrayValue()` Returns the value as a byte array.
    `byte` | `getByteValue()` Returns the value as a byte.
    `Calendar` | `getCalendarValue()` Returns the value as a `Calendar`.
    `Date` | `getDateValue()` Returns the value as a `Date`.
    `double` | `getDoubleValue()` Returns the value as a double.
    `StringEnumAbstractBase` | `getEnumValue()` Returns the value as a `StringEnumAbstractBase`.
    `float` | `getFloatValue()` Returns the value as a float.
    `GDate` | `getGDateValue()` Returns the value as a `GDate`.
    `GDuration` | `getGDurationValue()` Returns the value as a `GDuration`.
    `int` | `getIntValue()` Returns the value as an int.
    `List<?>` | `getListValue()` Returns the value as a `List` of friendly Java objects (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration).
    `long` | `getLongValue()` Returns the value as a long.
    `Object` | `getObjectValue()` Returns a union value as a its natural friendly Java object (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration).
    `QName` | `getQNameValue()` Returns the value as a `QName`.
    `short` | `getShortValue()` Returns the value as a short.
    `String` | `getStringValue()` Returns the value as a `String`.
    `SchemaType` | `instanceType()` The same as getSchemaType unless this is a union instance or nil value.
    `void` | `setBigDecimalValue(BigDecimal obj)` Sets the value as a `BigDecimal`.
    `void` | `setBigIntegerValue(BigInteger obj)` Sets the value as a `BigInteger`.
    `void` | `setBooleanValue(boolean v)` Sets the value as a boolean.
    `void` | `setByteArrayValue(byte[] obj)` Sets the value as a byte array.
    `void` | `setByteValue(byte v)` Sets the value as a byte.
    `void` | `setCalendarValue(Calendar obj)` Sets the value as a `Calendar`.
    `void` | `setDateValue(Date obj)` Sets the value as a `Date`.
    `void` | `setDoubleValue(double v)` Sets the value as a double.
    `void` | `setEnumValue(StringEnumAbstractBase obj)` Sets the value as a `StringEnumAbstractBase`.
    `void` | `setFloatValue(float v)` Sets the value as a float.
    `void` | `setGDateValue(GDate obj)` Sets the value as a `GDate`.
    `void` | `setGDurationValue(GDuration obj)` Sets the value as a `GDuration`.
    `void` | `setIntValue(int v)` Sets the value as an int.
    `void` | `setListValue(List<?> obj)` Sets the value as a `List`.
    `void` | `setLongValue(long v)` Sets the value as a long.
    `void` | `setObjectValue(Object obj)` Sets the value as an arbitrary `Object`.
    `void` | `setQNameValue(QName obj)` Sets the value as a `QName`.
    `void` | `setShortValue(short v)` Sets the value as a short.
    `void` | `setStringValue(String obj)` Sets the value as a `String`.
    `List<? extends XmlAnySimpleType>` | `xgetListValue()` Returns the value as a `List` of XmlAnySimpleType objects.

    - ### Methods inherited from interface org.apache.xmlbeans.XmlObject

      `changeType, compareTo, compareValue, copy, copy, execQuery, execQuery, isImmutable, isNil, schemaType, selectAttribute, selectAttribute, selectAttributes, selectChildren, selectChildren, selectChildren, selectPath, selectPath, set, setNil, substitute, toString, validate, validate, valueEquals, valueHashCode`

    - ### Methods inherited from interface org.apache.xmlbeans.XmlTokenSource

      `documentProperties, dump, getDomNode, monitor, newCursor, newDomNode, newDomNode, newInputStream, newInputStream, newReader, newReader, newXMLStreamReader, newXMLStreamReader, save, save, save, save, save, save, save, save, xmlText, xmlText`

- - ### Method Detail

    - #### instanceType

          SchemaType instanceType()

      The same as getSchemaType unless this is a union instance or nil value.

      For unions, this returns the non-union consituent type of this instance. This type may change if setters are called that cause the instance to change to another constituent type of the union.

      For nil values, this returns null.

    - #### getStringValue

          String getStringValue()

      Returns the value as a `String`.

    - #### getBooleanValue

          boolean getBooleanValue()

      Returns the value as a boolean.

    - #### getByteValue

          byte getByteValue()

      Returns the value as a byte.

    - #### getShortValue

          short getShortValue()

      Returns the value as a short.

    - #### getIntValue

          int getIntValue()

      Returns the value as an int.

    - #### getLongValue

          long getLongValue()

      Returns the value as a long.

    - #### getBigIntegerValue

          BigInteger getBigIntegerValue()

      Returns the value as a `BigInteger`.

    - #### getBigDecimalValue

          BigDecimal getBigDecimalValue()

      Returns the value as a `BigDecimal`.

    - #### getFloatValue

          float getFloatValue()

      Returns the value as a float.

    - #### getDoubleValue

          double getDoubleValue()

      Returns the value as a double.

    - #### getByteArrayValue

          byte[] getByteArrayValue()

      Returns the value as a byte array.

    - #### getEnumValue

          StringEnumAbstractBase getEnumValue()

      Returns the value as a `StringEnumAbstractBase`.

    - #### getCalendarValue

          Calendar getCalendarValue()

      Returns the value as a `Calendar`.

    - #### getDateValue

          Date getDateValue()

      Returns the value as a `Date`.

    - #### getGDateValue

          GDate getGDateValue()

      Returns the value as a `GDate`.

    - #### getGDurationValue

          GDuration getGDurationValue()

      Returns the value as a `GDuration`.

    - #### getQNameValue

          QName getQNameValue()

      Returns the value as a `QName`.

    - #### getListValue

          List<?> getListValue()

      Returns the value as a `List` of friendly Java objects (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration).

    - #### xgetListValue

          List<? extends XmlAnySimpleType> xgetListValue()

      Returns the value as a `List` of XmlAnySimpleType objects.

    - #### getObjectValue

          Object getObjectValue()

      Returns a union value as a its natural friendly Java object (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration).

    - #### setStringValue

          void setStringValue(String obj)

      Sets the value as a `String`.

    - #### setBooleanValue

          void setBooleanValue(boolean v)

      Sets the value as a boolean.

    - #### setByteValue

          void setByteValue(byte v)

      Sets the value as a byte.

    - #### setShortValue

          void setShortValue(short v)

      Sets the value as a short.

    - #### setIntValue

          void setIntValue(int v)

      Sets the value as an int.

    - #### setLongValue

          void setLongValue(long v)

      Sets the value as a long.

    - #### setBigIntegerValue

          void setBigIntegerValue(BigInteger obj)

      Sets the value as a `BigInteger`.

    - #### setBigDecimalValue

          void setBigDecimalValue(BigDecimal obj)

      Sets the value as a `BigDecimal`.

    - #### setFloatValue

          void setFloatValue(float v)

      Sets the value as a float.

    - #### setDoubleValue

          void setDoubleValue(double v)

      Sets the value as a double.

    - #### setByteArrayValue

          void setByteArrayValue(byte[] obj)

      Sets the value as a byte array.

    - #### setEnumValue

          void setEnumValue(StringEnumAbstractBase obj)

      Sets the value as a `StringEnumAbstractBase`.

    - #### setCalendarValue

          void setCalendarValue(Calendar obj)

      Sets the value as a `Calendar`.

    - #### setDateValue

          void setDateValue(Date obj)

      Sets the value as a `Date`.

    - #### setGDateValue

          void setGDateValue(GDate obj)

      Sets the value as a `GDate`.

    - #### setGDurationValue

          void setGDurationValue(GDuration obj)

      Sets the value as a `GDuration`.

    - #### setQNameValue

          void setQNameValue(QName obj)

      Sets the value as a `QName`.

    - #### setListValue

          void setListValue(List<?> obj)

      Sets the value as a `List`.

    - #### setObjectValue

          void setObjectValue(Object obj)

      Sets the value as an arbitrary `Object`.