Class Datatype

All Implemented Interfaces:
com.appiancorp.cache.CoupledValue, AppianType, com.appiancorp.type.DataType, com.appiancorp.type.DataTypeProperties, Serializable

@GwtCompatible public class Datatype extends DatatypeProperties implements com.appiancorp.type.DataType, com.appiancorp.cache.CoupledValue
Datatype The Datatype of a TypedValue. Types are immutable; once created, they never change on the backend. All builtin Datatypes have a parent of null (global). A Type number is constant once created in a given installation of the product, and thus a Type may be safely cached.
See Also:
  • Field Details

    • TYPE_PROPERTY_UNION_KEYS

      public static final String TYPE_PROPERTY_UNION_KEYS
      The name of the type property that holds the type keys used to identify the types that are part of a union (ie. for a type that has AppianType.UNION as its foundation type).
      See Also:
    • TYPE_PROPERTY_UNION_TYPES

      public static final String TYPE_PROPERTY_UNION_TYPES
      The name of the type property that holds the type ids of the types that are part of a union (ie. for a type that has AppianType.UNION as its foundation type).
      See Also:
  • Constructor Details

    • Datatype

      public Datatype()
  • Method Details

    • getInstanceProperties

      public NamedTypedValue[] getInstanceProperties()
      Instance properties apply to an individual instance, and as such have their values stored with each individual instance, not with the type itself. This includes properties such as a variant's type.
      Specified by:
      getInstanceProperties in interface com.appiancorp.type.DataType
      Returns:
      the instance properties
    • setInstanceProperties

      public void setInstanceProperties(NamedTypedValue[] instanceProperties)
    • getInstanceProperty

      public NamedTypedValue getInstanceProperty(String name_)
      Searches the instance properties for one with the specified name and returns it.
      Parameters:
      name_ - The name of the instance property to find
      Returns:
      the instance property if found, otherwise null
    • getInstancePropertyIndex

      public int getInstancePropertyIndex(String name_)
      Searches the instance properties for one with the specified name and returns its index.
      Parameters:
      name_ - The name of the instance property to find.
      Returns:
      The instance property index if found; otherwise -1.
    • getTypeProperties

      public NamedTypedValue[] getTypeProperties()
      Type properties apply to the type as a whole, not individual instances of the type. The type properties have the value at the type level. This includes properties such as the named fields within a record.
      Returns:
      the type properties
    • setTypeProperties

      public void setTypeProperties(NamedTypedValue[] typeProperties)
    • getTypeProperty

      public NamedTypedValue getTypeProperty(String name_)
      Searches the type properties for one with the specified name and returns it.
      Parameters:
      name_ - The name of the type property to find
      Returns:
      the type property
    • getTypePropertyIndex

      public int getTypePropertyIndex(String name_)
      Searches the type properties for one with the specified name and returns its index.
      Parameters:
      name_ - The name of the type property to find.
      Returns:
      The type property index if found; otherwise -1.
    • getParent

      public TypedValue getParent()
      This is context where the datatype is stored. For example, a datatype specific to a process model could have that process model as a parent. Global datatypes have null as the parent. Currently all datatypes are global.
      Returns:
      the parent of this datatype
    • setParent

      public void setParent(TypedValue parent_)
    • getDefault

      public TypedValue getDefault()
      This is the default value for the type.
      Returns:
      the default value
    • setDefault

      public void setDefault(TypedValue defaultValue)
    • getNull

      public TypedValue getNull()
      This is the null value for the type.
      Returns:
      null value
    • setNull

      public void setNull(TypedValue nullValue)
    • getFoundation

      public static Long getFoundation(Long instanceType_)
      Gets the type id of the foundation of a given type. If the specified type does not exist, instanceType is returned.
      Parameters:
      instanceType_ - the type
      Returns:
      the type's foundation type id
    • getValidFoundation

      public static Long getValidFoundation(Long instanceType_) throws InvalidTypeException
      Gets the type id of the foundation of a given type. If the specified type does not exist, InvalidTypeException thrown if not.
      Parameters:
      instanceType_ - the type
      Returns:
      the type's foundation type id
      Throws:
      InvalidTypeException
    • hasFoundation

      public static boolean hasFoundation(Long instanceType_, Long foundationType_)
      Checks whether a type has a particular type as its foundation type.
      Parameters:
      instanceType_ - the type whose foundation will be checked
      foundationType_ - the foundation type that we're checking against
      Returns:
      whether the given type has the given foundation type as its foundation
    • isAutoGeneratedType

      public boolean isAutoGeneratedType()
      Returns whether the type was auto-generated. When importing types from XSD or creating web service types, extra types that are not defined in the XSD or WSDL are auto-generated, such as list types and others.
      Returns:
      true if the type was auto-generated, false otherwise
    • findByQName

      public static Datatype findByQName(Datatype[] dts, QName targetQName)
      Finds the Datatype object in the given array that has the given qname. If no such object is present or if the given array is null, returns null.
    • getListViewMapping

      public String getListViewMapping()
      Returns the expression that maps instances of this type to instances of the com.appiancorp.record.data.ListViewItem type.
    • setListViewMapping

      public void setListViewMapping(String listViewMapping)
      Sets an expression that maps instances of this type to instances of the com.appiancorp.record.data.ListViewItem type.
    • getCoupledValueType

      public int getCoupledValueType()
      INTERNAL: NOT API
      Specified by:
      getCoupledValueType in interface com.appiancorp.cache.CoupledValue
      Overrides:
      getCoupledValueType in class DatatypeProperties
    • addToCache

      public void addToCache(Map cache)
      INTERNAL: NOT API
      Overrides:
      addToCache in class DatatypeProperties