|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.wikitty.entities.FieldType
public class FieldType
| Nested Class Summary | |
|---|---|
static class |
FieldType.TYPE
|
| Field Summary | |
|---|---|
protected int |
lowerBound
|
static int |
NOLIMIT
|
static String |
NOT_NULL
tag/value use for not null |
protected FieldType.TYPE |
type
|
static String |
UNIQUE
tag/value use for unique |
protected int |
upperBound
|
| Constructor Summary | |
|---|---|
FieldType()
|
|
FieldType(FieldType.TYPE type,
int lowerBound,
int upperBound)
|
|
| Method Summary | |
|---|---|
void |
addTagValue(String tag,
String value)
|
protected Object |
getContainedValidObject(Object value)
Convert value in argument in right type for this FieldType. |
int |
getLowerBound()
|
Set<String> |
getTagNames()
|
String |
getTagValue(String tag)
|
Map<String,String> |
getTagValues()
|
FieldType.TYPE |
getType()
|
int |
getUpperBound()
|
Object |
getValidValue(Object value)
Return a valid value for this field. |
boolean |
isCollection()
Return true if this field have upperBound > 1. |
boolean |
isNotNull()
|
boolean |
isUnique()
|
boolean |
isValidValue(Object value)
Test if value in argument is valid for this field type. |
void |
setLowerBound(int lowerBound)
|
void |
setTagValues(Map<String,String> tagValues)
|
void |
setType(FieldType.TYPE type)
|
void |
setUpperBound(int upperBound)
|
String |
toDefinition(String name)
Return string definition for this field. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static String UNIQUE
public static String NOT_NULL
public static final int NOLIMIT
protected FieldType.TYPE type
protected int lowerBound
protected int upperBound
| Constructor Detail |
|---|
public FieldType()
public FieldType(FieldType.TYPE type,
int lowerBound,
int upperBound)
| Method Detail |
|---|
public void addTagValue(String tag,
String value)
public String getTagValue(String tag)
public Set<String> getTagNames()
public Map<String,String> getTagValues()
public void setTagValues(Map<String,String> tagValues)
public boolean isCollection()
true is field is collectionpublic String toDefinition(String name)
name - field name used for definition
protected Object getContainedValidObject(Object value)
value - value to convert
public Object getValidValue(Object value)
throws WikittyException
value - is casted if possible to an actual correct value.
WikittyException - if value can't be obtainedpublic boolean isValidValue(Object value)
value - to test
public FieldType.TYPE getType()
public void setType(FieldType.TYPE type)
public int getLowerBound()
public void setLowerBound(int lowerBound)
public int getUpperBound()
public void setUpperBound(int upperBound)
public boolean isUnique()
public boolean isNotNull()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||