Package commonj.sdo

Interface Type

All Known Implementing Classes:
SDOChangeSummaryType, SDODataObjectType, SDODataType, SDOObjectType, SDOOpenSequencedType, SDOPropertyType, SDOType, SDOTypeType, SDOWrapperType, SDOXMLHelperLoadOptionsType

public interface Type
A representation of the type of a property of a data object.
  • Method Summary

    Modifier and Type
    Method
    Description
    get(Property property)
    Returns the value of the specified instance property of this Type.
    Return a list of alias names for this Type.
    Returns the List of base Types for this Type.
    Returns the Properties declared in this Type as opposed to those declared in base Types.
    Returns the Java class that this type represents.
    Returns a read-only List of instance Properties available on this Type.
    Returns the name of the type.
    Returns the List of the Properties of this type.
    getProperty(String propertyName)
    Returns from all the Properties of this type, the one with the specified name.
    Returns the namespace URI of the type or null if the type has no URI (for example it was generated from a Schema with no target namespace).
    boolean
    Indicates if this Type is abstract.
    boolean
    Indicates if this Type specifies DataTypes (true) or DataObjects (false).
    boolean
    Returns whether the specified object is an instance of this type.
    boolean
    Indicates if this Type allows any form of open content.
    boolean
    Indicates if this Type specifies Sequenced DataObjects.
  • Method Details

    • getName

      String getName()
      Returns the name of the type.
      Returns:
      the type name.
    • getURI

      String getURI()
      Returns the namespace URI of the type or null if the type has no URI (for example it was generated from a Schema with no target namespace).
      Returns:
      the namespace URI.
    • getInstanceClass

      Class getInstanceClass()
      Returns the Java class that this type represents.
      Returns:
      the Java class.
    • isInstance

      boolean isInstance(Object object)
      Returns whether the specified object is an instance of this type.
      Parameters:
      object - the object in question.
      Returns:
      true if the object is an instance.
      See Also:
    • getProperties

      List getProperties()
      Returns the List of the Properties of this type.

      The expression

         type.getProperties().indexOf(property)
      
      yields the property's index relative to this type. As such, these expressions are equivalent:
          dataObject.get(i)
          dataObject.get((Property)dataObject.getType().getProperties().get(i));
      

      Returns:
      the Properties of the type.
      See Also:
    • getProperty

      Property getProperty(String propertyName)
      Returns from all the Properties of this type, the one with the specified name. As such, these expressions are equivalent:
          dataObject.get("name")
          dataObject.get(dataObject.getType().getProperty("name"))
      

      Returns:
      the Property with the specified name.
      See Also:
    • isDataType

      boolean isDataType()
      Indicates if this Type specifies DataTypes (true) or DataObjects (false). When false, any object that is an instance of this type also implements the DataObject interface. True for simple types such as Strings and numbers. For any object:
         isInstance(object) invalid input: '&'invalid input: '&' !isDataType() implies
         DataObject.class.isInstance(object) returns true. 
       
      Returns:
      true if Type specifies DataTypes, false for DataObjects.
    • isOpen

      boolean isOpen()
      Indicates if this Type allows any form of open content. If false, dataObject.getInstanceProperties() must be the same as dataObject.getType().getProperties() for any DataObject dataObject of this Type.
      Returns:
      true if this Type allows open content.
    • isSequenced

      boolean isSequenced()
      Indicates if this Type specifies Sequenced DataObjects. Sequenced DataObjects are used when the order of values between Properties must be preserved. When true, a DataObject will return a Sequence. For example,
        Sequence elements = dataObject.getSequence();
       
      Returns:
      true if this Type specifies Sequenced DataObjects.
    • isAbstract

      boolean isAbstract()
      Indicates if this Type is abstract. If true, this Type cannot be instantiated. Abstract types cannot be used in DataObject or DataFactory create methods.
      Returns:
      true if this Type is abstract.
    • getBaseTypes

      List getBaseTypes()
      Returns the List of base Types for this Type. The List is empty if there are no base Types. XSD , , and Java extends keyword are mapped to this list.
      Returns:
      the List of base Types for this Type.
    • getDeclaredProperties

      List getDeclaredProperties()
      Returns the Properties declared in this Type as opposed to those declared in base Types.
      Returns:
      the Properties declared in this Type.
    • getAliasNames

      List getAliasNames()
      Return a list of alias names for this Type.
      Returns:
      a list of alias names for this Type.
    • getInstanceProperties

      List getInstanceProperties()
      Returns a read-only List of instance Properties available on this Type.

      This list includes, at a minimum, any open content properties (extensions) added to the object before defining the Type's Type. Implementations may, but are not required to in the 2.1 version of SDO, provide additional instance properties.

      Returns:
      the List of instance Properties on this Type.
    • get

      Object get(Property property)
      Returns the value of the specified instance property of this Type.
      Parameters:
      property - one of the properties returned by getInstanceProperties().
      Returns:
      the value of the specified property.
      See Also: