Class Field

java.lang.Object
com.portal.pcm.Field
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
BinStrField, BufField, DecimalField, Element, EnumField, ErrField, Int64Field, IntField, NumField, ObjField, PoidField, StrField, SubStructField, TextBufField, TimeField, TStampField, UIntField

public class Field extends Object implements Cloneable, Serializable
The field class contains information not only on the field ID, but on the type associated with it, and its permissions. Access methods are typed using specific Field subtypes to acheive compile-time type checking.
See Also:
  • Field Details

  • Constructor Details

    • Field

      public Field(int nameID, int typeID, String name)
      Constructs an instance of Field from a name ID , typeID and name .
      Parameters:
      nameID - A valid Portal field name.
      typeID - A valid Portal storable class type name.
      name - Name of the field.
    • Field

      public Field(int nameID, int typeID)
      Constructs an instance of Field from a name ID and a type ID.
      Parameters:
      nameID - A valid Portal field name.
      typeID - A valid Portal storable class type name.
  • Method Details

    • fromPINName

      public static Field fromPINName(String name)
      Constructs and returns an instance of Field based on the name of the field as defined in the C header files.
      Parameters:
      name - The Field name string.
      Returns:
      A Field instance
    • fromName

      public static Field fromName(String origName)
      Constructs and returns an instance of Field based on the name of the field. If the name is in the form 'package.name', it is used literally. Otherwise, it is prepended by 'com.portal.pcm.fields.'. OrigName can be in the below formats
      1. com.portal.pcm.fields.< FieldName>
      2. PIN_FLD_XXX - OOB field with PIN_FLD_ prefix
      3. XXX_XXX - OOB field without PIN_FLD_ prefix
      4. PIN_FLD_XXX_XXX - custom field with PIN_FLD_ prefix
      5. XXX_XXX - custom field without PIN_FLD_ prefix
      6. FldPoid ,FldItems ,FldCustomerSegmentList,FldItemObj ..etc
      7. UnknownField123
      Parameters:
      origName - The Field name string
      Returns:
      A Field instance
    • fromName

      public static Field fromName(int nameid)
      Constructs and returns an instance of Field based on the name ID with type of the field. If the ID doesn't match any known Fields, one will be constructed.
      Parameters:
      nameid - The name ID of the field with type, as in the C headers
      Returns:
      A Field instance
    • clone

      public Object clone() throws CloneNotSupportedException
      Clones a field.
      Overrides:
      clone in class Object
      Returns:
      Clone of field.
      Throws:
      CloneNotSupportedException - thown if not supported.
    • getTypeID

      public int getTypeID()
      Returns the type name.
      Returns:
      The type name ID. 0 if not known.
    • getNameID

      public int getNameID()
      Returns the field name ID.
      Returns:
      The Field name ID without type information.
    • getName

      public int getName()
      Returns the field name.
      Returns:
      The Field name with type information.
    • getNameString

      public String getNameString()
      Returns the string name of the field as it appears in the C header files (for example, 'PIN_FLD_POID').
      Returns:
      The field name string as it appears in C header files.
    • getNameString

      public static String getNameString(int nameID)
      Returns the string name of the field as it appears in the C header files (for example, 'PIN_FLD_POID').
      Parameters:
      nameID - - A valid Portal field nameID.
      Returns:
      The field name string as it appears in C header files.
    • macroToClass

      public static String macroToClass(String name)
      Converts a string field name from the PIN macro form to the Java class name form.
      Parameters:
      name - Field name in PIN macro form.
      Returns:
      A string containing the equivelant class name.
    • getPINType

      public String getPINType()
      Returns a string representing the PIN type name of this field.
      Returns:
      Type name in PIN format.
    • hashCode

      public int hashCode()
      Returns a hash value for this object.
      Overrides:
      hashCode in class Object
      Returns:
      A hash value, nominally the name ID.
    • equals

      public boolean equals(Object other)
      Determines if two fields are equal. This is true when their names match.
      Overrides:
      equals in class Object
      Parameters:
      other - The other field.
      Returns:
      true if the name ID of both fields is the same.
    • toString

      public String toString()
      Returns a string representation of field.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this field.