public class ExtendedProperty extends Object
ExtendableData
Modifier and Type | Field and Description |
---|---|
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 boolean |
restrictedEdit |
private String |
title |
private Type |
type |
private boolean |
updateable |
private static Pattern |
valid
A regexp checking for invalid characters.
|
Constructor and Description |
---|
ExtendedProperty(String name,
String title,
String description,
String column,
Type type,
int length,
boolean nullable,
boolean insertable,
boolean updateable,
boolean restrictedEdit,
Formula.AverageMethod averageMethod,
List<ExtendedPropertyLinker> linkers)
Create a new extended property.
|
Modifier and Type | Method and Description |
---|---|
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 |
isRestrictedEdit()
Check if the value of this property is restricted for editing 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,
boolean nullIfException)
Parse a string and return an object of the correct type for this property.
|
void |
validateValue(Object value)
Check if an object is valid according to the specifications of this property.
|
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 boolean restrictedEdit
private final Formula.AverageMethod averageMethod
private final List<ExtendedPropertyLinker> linkers
ExtendedProperty(String name, String title, String description, String column, Type type, int length, boolean nullable, boolean insertable, boolean updateable, boolean restrictedEdit, Formula.AverageMethod averageMethod, List<ExtendedPropertyLinker> linkers)
public static boolean isValidName(String name)
name
- Name to checkpublic 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 isRestrictedEdit()
User
items to lock some properties for non-administrator
editing.public boolean isAveragable()
getAverageMethod()
public Formula.AverageMethod getAverageMethod()
public Object parseString(String value) throws InvalidDataException
value
- The value to parseInvalidDataException
- 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 exceptionInvalidDataException
- 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 checkInvalidDataException
public String getUrl(Object value)
value
- The value to link