public class Field<T> extends Object implements FieldAttributes<T>, Cloneable
| Constructor and Description |
|---|
Field(AccessPoemException accessException,
FieldAttributes<T> attrs)
Constructor for a Field with an access violation.
|
Field(Object raw,
FieldAttributes<T> attrs)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static Field |
basic(Object value,
String name,
PoemType type)
A convenience method to create a Field.
|
Object |
clone() |
void |
dump(PrintStream p)
Dump to a PrintStream.
|
Object |
getCooked() |
String |
getCookedString() |
String |
getCookedString(PoemLocale locale,
int style) |
String |
getDescription() |
String |
getDisplayName() |
Enumeration<Field<T>> |
getFirst1000Possibilities()
Return a limited enumeration of possibilities.
|
int |
getHeight() |
boolean |
getIndexed() |
String |
getName() |
Enumeration<Field<T>> |
getPossibilities()
Might be a bit big for some Reference types.
|
T |
getRaw()
Get the value of the Field.
|
Object |
getRawString()
Get the value as a String.
|
String |
getRenderInfo() |
PoemType<T> |
getType() |
boolean |
getUserCreateable() |
boolean |
getUserEditable() |
int |
getWidth() |
static Field |
integer(Integer value,
String name)
A convenience method to create nullable Integer Field.
|
static Field |
reference(Persistent value,
String name)
A convenience method to create a populated, nullable, Reference Field.
|
static Field |
reference(Table table,
String name)
A convenience method to create new unpopulated, nullable Reference Field.
|
boolean |
sameRawAs(Field<T> other)
Compare raws.
|
static Field |
string(String value,
String name)
A convenience method to create nullable String Field.
|
String |
toString()
Dump to a string.
|
Field<T> |
withDescription(String description)
Clone with a new description.
|
Field<T> |
withName(String name)
Clone with a new name.
|
Field<T> |
withNullable(boolean nullable)
Clone with a different nullability.
|
Field<T> |
withRaw(T rawP)
Clone this Field with a new value but same metadata.
|
public Field(Object raw, FieldAttributes<T> attrs)
raw - the object value, integer for reference typesattrs - the metadata attributes to setpublic Field(AccessPoemException accessException, FieldAttributes<T> attrs)
accessException - the access violationattrs - the metadata attributes to setpublic Object clone()
clone in class ObjectObject.clone()public String getName()
getName in interface FieldAttributes<T>FieldAttributes.getName()public String getDisplayName()
getDisplayName in interface FieldAttributes<T>FieldAttributes.getDisplayName()public String getDescription()
getDescription in interface FieldAttributes<T>FieldAttributes.getDescription()public PoemType<T> getType()
getType in interface FieldAttributes<T>FieldAttributes.getType()public boolean getIndexed()
getIndexed in interface FieldAttributes<T>FieldAttributes.getIndexed()public boolean getUserEditable()
getUserEditable in interface FieldAttributes<T>FieldAttributes.getUserEditable()public boolean getUserCreateable()
getUserCreateable in interface FieldAttributes<T>FieldAttributes.getUserCreateable()public int getWidth()
getWidth in interface FieldAttributes<T>FieldAttributes.getWidth()public int getHeight()
getHeight in interface FieldAttributes<T>FieldAttributes.getHeight()public String getRenderInfo()
getRenderInfo in interface FieldAttributes<T>FieldAttributes.getRenderInfo()public final T getRaw() throws AccessPoemException
AccessPoemException - FIXME Integer/Persistent issuepublic final Object getRawString() throws AccessPoemException
AccessPoemException - if the current AccessToken does not permit readingpublic final Object getCooked() throws AccessPoemException
AccessPoemException - if the current AccessToken does not permit readingpublic final String getCookedString() throws AccessPoemException
AccessPoemExceptionpublic final String getCookedString(PoemLocale locale, int style) throws AccessPoemException
locale - used in date renderingstyle - used in date renderingAccessPoemException - if the current AccessToken does not permit readingpublic Field<T> withRaw(T rawP)
rawP - new value to setpublic Field<T> withNullable(boolean nullable)
nullable - the new nullabilitypublic Field<T> withName(String name)
name - the new namepublic Field<T> withDescription(String description)
description - the new descriptionpublic Enumeration<Field<T>> getPossibilities()
null for String or Integer Types.public Enumeration<Field<T>> getFirst1000Possibilities()
public boolean sameRawAs(Field<T> other) throws AccessPoemException
other - another field to checkAccessPoemException - if it is already setpublic void dump(PrintStream p)
p - the PRintStream to write topublic String toString()
toString in class ObjectObject.toString()public static Field basic(Object value, String name, PoemType type)
value - the Object to set the value toname - the name of the new Field, also used as descriptiontype - the PoemType of the Fieldpublic static Field string(String value, String name)
value - the String to set the value toname - the name of the new Field, also used as descriptionpublic static Field integer(Integer value, String name)
value - the Integer to set the value toname - the name of the new Field, also used as descriptionpublic static Field reference(Persistent value, String name)
value - the Persistent to set the value toname - the name of the new Field, also used as descriptionpublic static Field reference(Table table, String name)
table - the Table to refer toname - the name of the new Field, also used as descriptionCopyright © 2000–2021 PanEris. All rights reserved.