Class Portfolio.FieldType

  • All Implemented Interfaces:
    java.lang.Cloneable
    Enclosing class:
    Portfolio

    public static class Portfolio.FieldType
    extends java.lang.Object
    The FieldType class determines which properties of an EmbeddedFile are presented in the user-interface. For example, when presenting a collection of emails, it would be more useful to present columns as "To", "From", "Subject", "Date" and so on rather than the columns normally associated with file size.
    See Also:
    Portfolio.getSchema(), EmbeddedFile.getProperties()
    • Constructor Summary

      Constructors 
      Constructor Description
      FieldType​(java.lang.String name, java.lang.String type)
      Create a new FieldType
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.Object clone()  
      int getColumnSort()
      Return a value which can be used to determine which order the fields will be presented in the user-interface.
      java.lang.String getName()
      Return the name of the field, as set by setName(java.lang.String)
      java.lang.String getType()
      Return the type of field, as set by setType(java.lang.String)
      java.lang.Object getValue​(EmbeddedFile ef, java.lang.String key)
      Return the value matching this type from the specified EmbeddedFile.
      boolean isEditable()
      Return the editability flag as set by setEditable(boolean)
      boolean isHidden()
      Return the hidden flag as set by setHidden(boolean)
      void putLiteral​(java.lang.String key, java.lang.String tokens)
      Put a literal token sequnce.
      void setColumnSort​(int sort)
      Set a value which can be used to determine which order the fields will be presented in the user-interface.
      void setEditable​(boolean editable)
      Set whether this property should be editable in the user-interface
      void setHidden​(boolean hidden)
      Set whether this column is to be hidden in the user-interface by default
      void setName​(java.lang.String name)
      Set the name of the field as it appears in the user-interface
      void setType​(java.lang.String type)
      Set the type of the field.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • setName

        public void setName​(java.lang.String name)
        Set the name of the field as it appears in the user-interface
        Parameters:
        name - the name, which must not be null or empty.
      • getColumnSort

        public int getColumnSort()
        Return a value which can be used to determine which order the fields will be presented in the user-interface. A value of 0 means unset
      • setColumnSort

        public void setColumnSort​(int sort)
        Set a value which can be used to determine which order the fields will be presented in the user-interface. A value of 0 means unset
        Parameters:
        sort - the sort order, or 0 for unset
      • setHidden

        public void setHidden​(boolean hidden)
        Set whether this column is to be hidden in the user-interface by default
        Parameters:
        hidden - if the column is hidden
      • isHidden

        public boolean isHidden()
        Return the hidden flag as set by setHidden(boolean)
      • setEditable

        public void setEditable​(boolean editable)
        Set whether this property should be editable in the user-interface
        Parameters:
        editable - the editabilty
      • isEditable

        public boolean isEditable()
        Return the editability flag as set by setEditable(boolean)
      • toString

        public java.lang.String toString()
      • getValue

        public java.lang.Object getValue​(EmbeddedFile ef,
                                         java.lang.String key)
        Return the value matching this type from the specified EmbeddedFile.
        Parameters:
        ef - the EmbeddedFile to query
        key - the key against which this FieldType is stored in the schema map
      • putLiteral

        public void putLiteral​(java.lang.String key,
                               java.lang.String tokens)
        Put a literal token sequnce. For debugging
        Parameters:
        key - the key
        tokens - the token sequence, eg "true" or "/foo" or "[/Foo/Bar]". No refs, just direct objects.
      • clone

        protected java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object