Package org.faceless.pdf2
Class Portfolio.FieldType
- java.lang.Object
-
- org.faceless.pdf2.Portfolio.FieldType
-
- All Implemented Interfaces:
Cloneable
- Enclosing class:
- Portfolio
public static class Portfolio.FieldType extends 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.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
clone()
int
getColumnSort()
Return a value which can be used to determine which order the fields will be presented in the user-interface.String
getName()
Return the name of the field, as set bysetName(java.lang.String)
String
getType()
Return the type of field, as set bysetType(java.lang.String)
Object
getValue(EmbeddedFile ef, String key)
Return the value matching this type from the specified EmbeddedFile.boolean
isEditable()
Return the editability flag as set bysetEditable(boolean)
boolean
isHidden()
Return the hidden flag as set bysetHidden(boolean)
void
putLiteral(String key, 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-interfacevoid
setHidden(boolean hidden)
Set whether this column is to be hidden in the user-interface by defaultvoid
setName(String name)
Set the name of the field as it appears in the user-interfacevoid
setType(String type)
Set the type of the field.String
toString()
-
-
-
Constructor Detail
-
FieldType
public FieldType(String name, String type)
Create a new FieldType- Parameters:
name
- the name, passed tosetName(java.lang.String)
name
- the type, passed tosetType(java.lang.String)
-
-
Method Detail
-
getName
public String getName()
Return the name of the field, as set bysetName(java.lang.String)
-
setName
public void setName(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.
-
setType
public void setType(String type)
Set the type of the field. The currently defined types are- text - a general text field
- date - a general date field
- number - a general number field
- name - the name of the EmbeddedFile as set by
EmbeddedFile.setName(java.lang.String)
- description - the description of the EmbeddedFile as set by
EmbeddedFile.setDescription(java.lang.String)
- moddate - the modification date of the EmbeddedFile as set by
EmbeddedFile.setModDate(Calendar)
- creationdate - the creation date of the EmbeddedFile as set by
EmbeddedFile.setCreationDate(Calendar)
- size - the size of the EmbeddedFile as returned by
EmbeddedFile.getSize()
- compressedsize - the compressed size of the EmbeddedFile, as it is stored in the PDF
-
getType
public String getType()
Return the type of field, as set bysetType(java.lang.String)
-
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 bysetHidden(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 bysetEditable(boolean)
-
toString
public String toString()
-
getValue
public Object getValue(EmbeddedFile ef, String key)
Return the value matching this type from the specified EmbeddedFile.- Parameters:
ef
- the EmbeddedFile to querykey
- the key against which this FieldType is stored in the schema map
-
putLiteral
public void putLiteral(String key, String tokens)
Put a literal token sequnce. For debugging- Parameters:
key
- the keytokens
- the token sequence, eg "true" or "/foo" or "[/Foo/Bar]". No refs, just direct objects.
-
-