|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.melati.poem.Field
public class Field
A Field. A field is a value (the raw) with its metadata (a set of attributes) and possibly an access violation if the current user is not allowed to access it.
Constructor Summary | |
---|---|
Field(AccessPoemException accessException,
FieldAttributes attrs)
Constructor for a Field with an access violation. |
|
Field(Object raw,
FieldAttributes attrs)
Constructor. |
Method Summary | |
---|---|
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 |
getFirst1000Possibilities()
Return a limited enumeration of possibilities. |
int |
getHeight()
|
boolean |
getIndexed()
|
String |
getName()
|
Enumeration |
getPossibilities()
Might be a bit big for some Reference types. |
Object |
getRaw()
Get the value of the Field. |
Object |
getRawString()
Get the value as a String. |
String |
getRenderInfo()
|
PoemType |
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 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 |
withDescription(String description)
Clone with a new description. |
Field |
withName(String name)
Clone with a new name. |
Field |
withNullable(boolean nullable)
Clone with a different nullability. |
Field |
withRaw(Object rawP)
Clone this Field with a new value but same metadata. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Field(Object raw, FieldAttributes attrs)
raw
- the object value, integer for reference typesattrs
- the metadata attributes to setpublic Field(AccessPoemException accessException, FieldAttributes attrs)
accessException
- the access violationattrs
- the metadata attributes to setMethod Detail |
---|
public Object clone()
clone
in class Object
Object.clone()
public String getName()
getName
in interface FieldAttributes
FieldAttributes.getName()
public String getDisplayName()
getDisplayName
in interface FieldAttributes
FieldAttributes.getDisplayName()
public String getDescription()
getDescription
in interface FieldAttributes
FieldAttributes.getDescription()
public PoemType getType()
getType
in interface FieldAttributes
FieldAttributes.getType()
public boolean getIndexed()
getIndexed
in interface FieldAttributes
FieldAttributes.getIndexed()
public boolean getUserEditable()
getUserEditable
in interface FieldAttributes
FieldAttributes.getUserEditable()
public boolean getUserCreateable()
getUserCreateable
in interface FieldAttributes
FieldAttributes.getUserCreateable()
public int getWidth()
getWidth
in interface FieldAttributes
FieldAttributes.getWidth()
public int getHeight()
getHeight
in interface FieldAttributes
FieldAttributes.getHeight()
public String getRenderInfo()
getRenderInfo
in interface FieldAttributes
FieldAttributes.getRenderInfo()
public final Object getRaw() throws AccessPoemException
AccessPoemException
public 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
AccessPoemException
public final String getCookedString(PoemLocale locale, int style) throws AccessPoemException
locale
- style
-
AccessPoemException
- if the current AccessToken does not permit readingpublic Field withRaw(Object rawP)
rawP
- new value to set
public Field withNullable(boolean nullable)
nullable
- the new nullability
public Field withName(String name)
name
- the new name
public Field withDescription(String description)
description
- the new description
public Enumeration getPossibilities()
null
for String or Integer Types.
public Enumeration getFirst1000Possibilities()
public boolean sameRawAs(Field other) throws AccessPoemException
other
- another field to check
AccessPoemException
- if it is already setpublic void dump(PrintStream p)
p
- the PRintStream to write topublic String toString()
toString
in class Object
Object.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 Field
public static Field string(String value, String name)
value
- the String to set the value toname
- the name of the new Field, also used as description
public static Field integer(Integer value, String name)
value
- the Integer to set the value toname
- the name of the new Field, also used as description
public static Field reference(Persistent value, String name)
value
- the Persistent to set the value toname
- the name of the new Field, also used as description
public static Field reference(Table table, String name)
table
- the Table to refer toname
- the name of the new Field, also used as description
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |