|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.ExtendedProperty
public class ExtendedProperty
Holds information about an extended property for a class.
ExtendableData
Field Summary | |
---|---|
private Formula.AverageMethod |
averageMethod
|
private String |
column
|
private String |
description
|
private boolean |
insertable
|
private int |
length
|
private List<ExtendedPropertyLinker> |
linkers
|
private String |
name
|
private boolean |
nullable
|
private String |
title
|
private Type |
type
|
private boolean |
updateable
|
private static Pattern |
valid
A regexp checking for invalid characters. |
Constructor Summary | |
---|---|
ExtendedProperty(String name,
String title,
String description,
String column,
Type type,
int length,
boolean nullable,
boolean insertable,
boolean updateable,
Formula.AverageMethod averageMethod,
List<ExtendedPropertyLinker> linkers)
Create a new extended property. |
Method Summary | |
---|---|
Formula.AverageMethod |
getAverageMethod()
Which method to use when calculating the average of a set of values. |
String |
getColumn()
Get the database column of the extended property. |
String |
getDescription()
Get a description of the extended property. |
int |
getLength()
Get the maximum allowed length of the property value. |
String |
getName()
Get the name of the extended property. |
String |
getTitle()
Get the title of the extended property. |
Type |
getType()
Get the type of the extended property. |
String |
getUrl(Object value)
Create a link for this extended property. |
boolean |
isAveragable()
If it makes sense to take the average of multiple values for this property or not. |
boolean |
isInsertable()
Check if the value of this property should be inserted into the datbase when creating new items. |
boolean |
isNullable()
Check if the property allows null values or not. |
boolean |
isUpdateable()
Check if the value of this property should be updated in the database when an item is updated. |
static boolean |
isValidName(String name)
Check that the name only contains a-zA-Z0-9_ and starts with a letter or underscore. |
Object |
parseString(String value)
Parse a string and return an object of the correct type for this property. |
Object |
parseString(String value,
NumberFormat numberFormat)
Deprecated. Use parseString(String, NumberFormat, boolean) instead |
Object |
parseString(String value,
NumberFormat numberFormat,
boolean nullIfException)
Parse a string and return an object of the correct type for this property. |
ExtendedPropertyInfo |
toTransferable(ExtendedPropertyInfo info)
Transfer the internal state to a transferable object. |
void |
validateValue(Object value)
Check if an object is valid according to the specifications of this property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Pattern valid
private final String name
private final Type type
private final String column
private final String title
private final String description
private final int length
private final boolean nullable
private final boolean insertable
private final boolean updateable
private final Formula.AverageMethod averageMethod
private final List<ExtendedPropertyLinker> linkers
Constructor Detail |
---|
ExtendedProperty(String name, String title, String description, String column, Type type, int length, boolean nullable, boolean insertable, boolean updateable, Formula.AverageMethod averageMethod, List<ExtendedPropertyLinker> linkers)
Method Detail |
---|
public static boolean isValidName(String name)
name
- Name to check
public String getName()
name
parameter of the
getExtended/setExtended
methods to get or
set the value of the property of an Extendable
item.
ExtendableData.getExtended
,
ExtendableData.setExtended
public String getTitle()
public String getDescription()
public String getColumn()
String
public Type getType()
Type
enumeration.
public int getLength()
public boolean isNullable()
public boolean isInsertable()
public boolean isUpdateable()
public boolean isAveragable()
getAverageMethod()
public Formula.AverageMethod getAverageMethod()
public Object parseString(String value) throws InvalidDataException
value
- The value to parse
InvalidDataException
- If the string cannot be converted to the correct typegetType()
public Object parseString(String value, NumberFormat numberFormat)
parseString(String, NumberFormat, boolean)
instead
value
- The value to parsenumberFormat
- The number format, or null to use Double.valueOf
InvalidDataException
- If the string cannot be converted to the correct typegetType()
public Object parseString(String value, NumberFormat numberFormat, boolean nullIfException)
value
- The value to parsenumberFormat
- The number format, or null to use Double.valueOfnullIfException
- TRUE to return null in case the string can't be parsed,
FALSE to throw an exception
InvalidDataException
- If the string cannot be converted to the correct type
and the nullIfException parameter is falsegetType()
public void validateValue(Object value) throws InvalidDataException
isNullable()
,
check that the object is of the correct getType()
and the maximum
getLength()
of a string.
value
- The value to check
InvalidDataException
public String getUrl(Object value)
value
- The value to link
public ExtendedPropertyInfo toTransferable(ExtendedPropertyInfo info)
ToTransferable
toTransferable
in interface ToTransferable<ExtendedPropertyInfo>
info
- The transferable object to use
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |