|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.uwyn.rife.site.ConstrainedProperty<T>
public class ConstrainedProperty<T extends ConstrainedProperty>
A ConstrainedProperty object makes it possible to easily
define all constraints for a named property of a bean.
The property name refers to the actual name of the bean property.
However, this sometimes doesn't correspond to its conceptual usage. It can
be handy to receive constraint violation reports with another conceptual
name: the subject name. Notice that this corresponds to the subject that is
used in a ValidationError. If no subject name is specified, the
property name will be used instead.
It's possible to add constraints to a ConstrainedProperty instance through regular setters, but chainable setters are also available to make it possible to easily define a series of constraints, for example:
ConstrainedProperty constrained = new ConstrainedProperty("password")
.maxLength(8)
.notNull(true);
Constrained properties are typically added to a Constrained bean
in its constructor. These are the static constraints that will be set for
each and every instance of the bean. You'll however most of the time use
the MetaData class that provides the activateMetaData method which initializes
the constraints on a need-to-have basis. This dramatically reduces memory
usage since otherwise all constraints will be initialized for every bean
instance, even though you don't use them, for example:
public class Credentials extends MetaData
{
private String mLogin = null;
private String mPassword = null;
private String mLanguage = null;
public Credentials()
{
}
public activateMetaData()
{
addConstraint(new ConstrainedProperty("login").maxLength(6).notNull(true));
addConstraint(new ConstrainedProperty("password").maxLength(8).notNull(true));
addConstraint(new ConstrainedProperty("language").notNull(true));
}
public void setLogin(String login) { mLogin = login; }
public String getLogin() { return mLogin; }
public void setPassword(String password) { mPassword = password; }
public String getPassword() { return mPassword; }
public void setLanguage(String language) { mLanguage = language; }
public String getLanguage() { return mLanguage; }
}
It's however also possible to add constraints to a single bean instance whenever they can't be determined beforehand. These are then dynamic constraints than can be populated at runtime, for example:
Credentials credentials = new Credentials();
credentials.addConstraint(new ConstrainedProperty("language").inList(new String[] {"nl", "fr", "en"}));
Constrained,
ConstrainedBean| Nested Class Summary | |
|---|---|
class |
ConstrainedProperty.ManyToMany
|
class |
ConstrainedProperty.ManyToManyAssociation
|
class |
ConstrainedProperty.ManyToOne
|
class |
ConstrainedProperty.ManyToOneAssociation
|
| Constructor Summary | |
|---|---|
ConstrainedProperty(String propertyName)
Creates a new ConstrainedProperty for the specified
property name. |
|
| Method Summary | |
|---|---|
void |
addListener(ConstrainedPropertyListener listener)
Adds a new listener. |
T |
autoRetrieved(boolean autoRetrieved)
Sets whether the content data of this property should be retrieved automatically from the back-end. |
ConstrainedProperty |
clone()
|
T |
constraint(String name,
Object constraintData)
Sets the data of a particular constraint in a generic fashion. |
T |
contentAttribute(String name,
boolean value)
Sets a named content attribute for this property that will be converted internally to a String value. |
T |
contentAttribute(String name,
byte value)
Sets a named content attribute for this property that will be converted internally to a String value. |
T |
contentAttribute(String name,
char value)
Sets a named content attribute for this property that will be converted internally to a String value. |
T |
contentAttribute(String name,
double value)
Sets a named content attribute for this property that will be converted internally to a String value. |
T |
contentAttribute(String name,
float value)
Sets a named content attribute for this property that will be converted internally to a String value. |
T |
contentAttribute(String name,
int value)
Sets a named content attribute for this property that will be converted internally to a String value. |
T |
contentAttribute(String name,
long value)
Sets a named content attribute for this property that will be converted internally to a String value. |
T |
contentAttribute(String name,
short value)
Sets a named content attribute for this property that will be converted internally to a String value. |
T |
contentAttribute(String name,
String value)
Sets a named content attribute for this property. |
T |
defaultValue(boolean value)
|
T |
defaultValue(byte value)
|
T |
defaultValue(char value)
|
T |
defaultValue(double value)
|
T |
defaultValue(float value)
|
T |
defaultValue(int value)
|
T |
defaultValue(long value)
|
T |
defaultValue(Object value)
|
T |
defaultValue(short value)
|
T |
displayedRaw(boolean displayedRaw)
|
T |
editable(boolean editable)
|
T |
email(boolean email)
|
T |
file(boolean file)
|
T |
format(Format format)
|
T |
fragment(boolean fragment)
Sets whether the content data of this property is a fragment. |
Object |
getCachedLoadedData()
Retrieves the cached loaded content data. |
Object |
getConstraint(String name)
Retrieves the value of a particular constraint in a generic fashion |
Map<String,Object> |
getConstraints()
Retrieves the map of all the constraints. |
Map<String,String> |
getContentAttributes()
Retrieves the map of named content attributes for this property. |
Object |
getDefaultValue()
|
Format |
getFormat()
|
String[] |
getInList()
|
ConstrainedProperty.ManyToMany |
getManyToMany()
|
ConstrainedProperty.ManyToManyAssociation |
getManyToManyAssociation()
|
ConstrainedProperty.ManyToOne |
getManyToOne()
|
ConstrainedProperty.ManyToOneAssociation |
getManyToOneAssociation()
|
Date |
getMaxDate()
|
int |
getMaxLength()
|
MimeType |
getMimeType()
Retrieves the mime type of the property. |
Date |
getMinDate()
|
int |
getMinLength()
|
String |
getName()
Retrieves the name of this property. |
Object |
getNotEqual()
Retrieves the reference object to which the property value can't be equal. |
String |
getOrdinalRestriction()
Retrieves the ordinal restriction of this property. |
int |
getPosition()
Retrieves the position in which the property should be displayed. |
int |
getPrecision()
|
String |
getPropertyName()
Retrieves the property name. |
Comparable |
getRangeBegin()
|
Comparable |
getRangeEnd()
|
String |
getRegexp()
|
String |
getRepository()
Retrieves the repository where the content data of this property will be stored. |
String |
getSameAs()
|
int |
getScale()
|
String |
getSubjectName()
Retrieves the subject name. |
ContentTransformer |
getTransformer()
Retrieves the content transformer of this property. |
boolean |
hasDefaultValue()
|
boolean |
hasLimitedLength()
|
boolean |
hasManyToMany()
|
boolean |
hasManyToManyAssociation()
|
boolean |
hasManyToOne()
|
boolean |
hasManyToOneAssociation()
|
boolean |
hasMaxLength()
|
boolean |
hasMimeType()
Indicates whether the property has a mime type. |
boolean |
hasMixLength()
|
boolean |
hasName()
Indicates whether this property has a name. |
boolean |
hasOrdinalRestriction()
Indicates whether this property has an ordinal restricting column. |
boolean |
hasPosition()
Indicates whether the position of the property is set. |
boolean |
hasPrecision()
|
boolean |
hasRepository()
Indicates whether this property will be stored in another repository than the default repository. |
boolean |
hasScale()
|
boolean |
hasTransformer()
Indicates whether this property has a content transformer. |
T |
identifier(boolean identifier)
Set whether the property value is an identifier. |
T |
inList(byte... inList)
|
T |
inList(char... inList)
|
T |
inList(Collection inList)
|
T |
inList(double... inList)
|
T |
inList(float... inList)
|
T |
inList(int... inList)
|
T |
inList(long... inList)
|
T |
inList(short... inList)
|
T |
inList(String... inList)
|
boolean |
isAutoRetrieved()
Indicates whether the content data of this property is automatically retrieved from the back-end. |
boolean |
isDisplayedRaw()
|
boolean |
isEditable()
|
boolean |
isEmail()
|
boolean |
isFile()
|
boolean |
isFormatted()
|
boolean |
isFragment()
Indicates whether the content data of this property is a fragment. |
boolean |
isIdentifier()
Retrieves whether the property is an identifier. |
boolean |
isInList()
|
boolean |
isLimitedDate()
|
boolean |
isListed()
Retrieves whether the property should be included in data lists. |
boolean |
isNotEmpty()
Retrieves whether the property value can be empty. |
boolean |
isNotEqual()
Retrieves whether the property can't be equal to a specific reference value. |
boolean |
isNotNull()
Retrieves whether the property value can be null. |
boolean |
isOrdinal()
Indicates whether this property has to be used as an ordinal. |
boolean |
isPersistent()
|
boolean |
isRange()
|
boolean |
isSameAs()
|
boolean |
isSaved()
|
boolean |
isSparse()
|
boolean |
isUnique()
Retrieves whether the property value has to be unique. |
boolean |
isUrl()
|
T |
listed(boolean listed)
Sets whether the property should be included in data lists. |
T |
manyToMany()
|
T |
manyToMany(Class klass)
|
T |
manyToMany(Class klass,
CreateTable.ViolationAction onUpdate,
CreateTable.ViolationAction onDelete)
|
T |
manyToMany(CreateTable.ViolationAction onUpdate,
CreateTable.ViolationAction onDelete)
|
T |
manyToManyAssociation()
|
T |
manyToManyAssociation(Class klass,
String property)
|
T |
manyToManyAssociation(String property)
|
T |
manyToOne()
|
T |
manyToOne(Class klass)
|
T |
manyToOne(Class klass,
String columnReference)
|
T |
manyToOne(Class klass,
String columnReference,
CreateTable.ViolationAction onUpdate,
CreateTable.ViolationAction onDelete)
|
T |
manyToOne(String table,
String columnReference)
|
T |
manyToOne(String table,
String columnReference,
CreateTable.ViolationAction onUpdate,
CreateTable.ViolationAction onDelete)
|
T |
manyToOneAssociation()
|
T |
manyToOneAssociation(Class klass,
String property)
|
T |
manyToOneAssociation(String property)
|
boolean |
matchesRegexp()
|
T |
maxDate(Date maxDate)
|
T |
maxLength(int maxLength)
|
T |
mimeType(MimeType mimeType)
Sets the mime type of the property. |
T |
minDate(Date minDate)
|
T |
minLength(int minLength)
|
T |
name(String name)
Sets the name of the content data of this property. |
T |
notEmpty(boolean notEmpty)
Set whether the property value can be empty. |
T |
notEqual(boolean reference)
Set that the property value can't be equal to a specified boolean reference value. |
T |
notEqual(byte reference)
Set that the property value can't be equal to a specified byte reference value. |
T |
notEqual(char reference)
Set that the property value can't be equal to a specified char reference value. |
T |
notEqual(double reference)
Set that the property value can't be equal to a specified double reference value. |
T |
notEqual(float reference)
Set that the property value can't be equal to a specified float reference value. |
T |
notEqual(int reference)
Set that the property value can't be equal to a specified int reference value. |
T |
notEqual(long reference)
Set that the property value can't be equal to a specified long reference value. |
T |
notEqual(Object reference)
Set that the property value can't be equal to a specified Object reference value. |
T |
notEqual(short reference)
Set that the property value can't be equal to a specified short reference value. |
T |
notNull(boolean notNull)
Set whether the property value can be null. |
T |
ordinal(boolean ordinal)
Sets whether this property has to be used as an ordinal. |
T |
ordinal(boolean ordinal,
String restriction)
Sets whether this property has to be used as an ordinal with a restricting column. |
T |
persistent(boolean persistent)
|
T |
position(int position)
Sets the position in which the property should be displayed. |
T |
precision(int precision)
|
T |
rangeBegin(byte value)
|
T |
rangeBegin(char value)
|
T |
rangeBegin(Comparable value)
|
T |
rangeBegin(double value)
|
T |
rangeBegin(float value)
|
T |
rangeBegin(int value)
|
T |
rangeBegin(long value)
|
T |
rangeBegin(short value)
|
T |
rangeEnd(byte value)
|
T |
rangeEnd(char value)
|
T |
rangeEnd(Comparable value)
|
T |
rangeEnd(double value)
|
T |
rangeEnd(float value)
|
T |
rangeEnd(int value)
|
T |
rangeEnd(long value)
|
T |
rangeEnd(short value)
|
T |
regexp(String regexp)
|
boolean |
removeListener(ConstrainedPropertyListener listener)
Removes a listener. |
T |
repository(String repository)
Sets the repository where the content data of this property will be stored. |
T |
sameAs(String reference)
|
T |
saved(boolean saved)
|
T |
scale(int scale)
|
void |
setAutoRetrieved(boolean autoRetrieved)
Sets whether the content data of this property should be retrieved automatically from the back-end. |
void |
setCachedLoadedData(Object data)
Sets the cached loaded data. |
void |
setConstraint(String name,
Object constraintData)
Sets the data of a particular constraint in a generic fashion. |
void |
setDefaultValue(Object value)
|
void |
setDisplayedRaw(boolean displayedRaw)
|
void |
setEditable(boolean editable)
|
void |
setEmail(boolean email)
|
void |
setFile(boolean file)
|
void |
setFormat(Format format)
|
void |
setFragment(boolean fragment)
Sets whether the content data of this property is a fragment. |
void |
setIdentifier(boolean identifier)
Set whether the property value is an identifier. |
void |
setInList(byte... inList)
|
void |
setInList(char... inList)
|
void |
setInList(Collection inList)
|
void |
setInList(double... inList)
|
void |
setInList(float... inList)
|
void |
setInList(int... inList)
|
void |
setInList(long... inList)
|
void |
setInList(short... inList)
|
void |
setInList(String... inList)
|
void |
setListed(boolean listed)
Sets whether the property should be included in data lists. |
void |
setManyToMany()
|
void |
setManyToMany(Class klass)
|
void |
setManyToMany(Class klass,
CreateTable.ViolationAction onUpdate,
CreateTable.ViolationAction onDelete)
|
void |
setManyToMany(CreateTable.ViolationAction onUpdate,
CreateTable.ViolationAction onDelete)
|
void |
setManyToManyAssociation()
|
void |
setManyToManyAssociation(Class klass,
String property)
|
void |
setManyToManyAssociation(String property)
|
void |
setManyToOne()
|
void |
setManyToOne(Class klass)
|
void |
setManyToOne(Class klass,
String columnReference)
|
void |
setManyToOne(Class klass,
String columnReference,
CreateTable.ViolationAction onUpdate,
CreateTable.ViolationAction onDelete)
|
void |
setManyToOne(String table,
String columnReference)
|
void |
setManyToOne(String table,
String columnReference,
CreateTable.ViolationAction onUpdate,
CreateTable.ViolationAction onDelete)
|
void |
setManyToOneAssociation()
|
void |
setManyToOneAssociation(Class klass,
String property)
|
void |
setManyToOneAssociation(String property)
|
void |
setMaxDate(Date maxDate)
|
void |
setMaxLength(int maxLength)
|
void |
setMimeType(MimeType mimeType)
Sets the mime type of the property. |
void |
setMinDate(Date minDate)
|
void |
setMinLength(int minLength)
|
void |
setName(String name)
Sets the name of the content data of this property. |
void |
setNotEmpty(boolean notEmpty)
Set whether the property value can be empty. |
void |
setNotEqual(boolean reference)
Set that the property value can't be equal to a specified boolean reference value. |
void |
setNotEqual(byte reference)
Set that the property value can't be equal to a specified byte reference value. |
void |
setNotEqual(char reference)
Set that the property value can't be equal to a specified char reference value. |
void |
setNotEqual(double reference)
Set that the property value can't be equal to a specified double reference value. |
void |
setNotEqual(float reference)
Set that the property value can't be equal to a specified float reference value. |
void |
setNotEqual(int reference)
Set that the property value can't be equal to a specified int reference value. |
void |
setNotEqual(long reference)
Set that the property value can't be equal to a specified long reference value. |
void |
setNotEqual(Object reference)
Set that the property value can't be equal to a specified Object reference value. |
void |
setNotEqual(short reference)
Set that the property value can't be equal to a specified short reference value. |
void |
setNotNull(boolean notNull)
Set whether the property value can be null. |
void |
setOrdinal(boolean ordinal)
Sets whether this property has to be used as an ordinal. |
void |
setOrdinal(boolean ordinal,
String restriction)
Sets whether this property has to be used as an ordinal with a restricting column. |
void |
setPersistent(boolean persistent)
|
void |
setPosition(int position)
Sets the position in which the property should be displayed. |
void |
setPrecision(int precision)
|
void |
setRangeBegin(byte value)
|
void |
setRangeBegin(char value)
|
void |
setRangeBegin(Comparable rangeBegin)
|
void |
setRangeBegin(double value)
|
void |
setRangeBegin(float value)
|
void |
setRangeBegin(int value)
|
void |
setRangeBegin(long value)
|
void |
setRangeBegin(short value)
|
void |
setRangeEnd(byte value)
|
void |
setRangeEnd(char value)
|
void |
setRangeEnd(Comparable rangeEnd)
|
void |
setRangeEnd(double value)
|
void |
setRangeEnd(float value)
|
void |
setRangeEnd(int value)
|
void |
setRangeEnd(long value)
|
void |
setRangeEnd(short value)
|
void |
setRegexp(String regexp)
|
void |
setRepository(String repository)
Sets the repository where the content data of this property will be stored. |
void |
setSameAs(String reference)
|
void |
setSaved(boolean saved)
|
void |
setScale(int scale)
|
void |
setSparse(boolean sparse)
|
void |
setSubjectName(String name)
Sets the subject name. |
void |
setTransformer(ContentTransformer transformer)
Sets a content transformer for this property. |
void |
setUnique(boolean unique)
Set whether the property value has to be unique. |
void |
setUrl(boolean url)
|
T |
sparse(boolean sparse)
|
T |
subjectName(String name)
Sets the subject name. |
T |
transformer(ContentTransformer transformer)
Sets a content transformer for this property. |
T |
unique(boolean unique)
Set whether the property value has to be unique. |
T |
url(boolean url)
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String NOT_NULL
public static final String NOT_EMPTY
public static final String NOT_EQUAL
public static final String UNIQUE
public static final String IDENTIFIER
public static final String EDITABLE
public static final String PERSISTENT
public static final String SAVED
public static final String DISPLAYED_RAW
public static final String MIN_LENGTH
public static final String MAX_LENGTH
public static final String SCALE
public static final String REGEXP
public static final String EMAIL
public static final String URL
public static final String MIN_DATE
public static final String MAX_DATE
public static final String IN_LIST
public static final String RANGE_BEGIN
public static final String RANGE_END
public static final String DEFAULT_VALUE
public static final String SAME_AS
public static final String MANY_TO_ONE
public static final String MANY_TO_ONE_ASSOCIATION
public static final String MANY_TO_MANY
public static final String MANY_TO_MANY_ASSOCIATION
public static final String FORMAT
public static final String FILE
public static final String SPARSE
public static final String LISTED
public static final String POSITION
public static final String MIMETYPE
public static final String AUTO_RETRIEVED
public static final String FRAGMENT
public static final String NAME
public static final String REPOSITORY
public static final String ORDINAL
public static final String ORDINAL_RESTRICTION
public static final String CONTENT_ATTRIBUTES
public static final String TRANSFORMER
public static final String CACHED_LOADED_DATA
protected Map<String,Object> mConstraints
protected List<ConstrainedPropertyListener> mListeners
| Constructor Detail |
|---|
public ConstrainedProperty(String propertyName)
ConstrainedProperty for the specified
property name.
propertyName - the name of the property that has to be
constrained| Method Detail |
|---|
public void addListener(ConstrainedPropertyListener listener)
Listeners will be notified when events occur that are specified in the
ConstrainedPropertyListener interface.
listener - the listener instance that will be addedpublic boolean removeListener(ConstrainedPropertyListener listener)
Once the listener has been removed, it will not receive any events anymore.
listener - the listener instance that will be removed
true when the listener could be found and has been removed; or
false when the listener wasn't registered before
public T subjectName(String name)
name - the subject name
ConstrainedPropertypublic void setSubjectName(String name)
name - the subject namepublic String getSubjectName()
the property name if no subject was specified.
public String getPropertyName()
public T notNull(boolean notNull)
null.
Note that this has different meanings in different contexts:
null,
notNull - true when the value can't be
null; or false when the value can be
null.
ConstrainedPropertyisNotNull()public void setNotNull(boolean notNull)
null.
notNull(boolean)public boolean isNotNull()
null.
true when the value can't be null;
or
false when the value can be null.
notNull(boolean)public T notEmpty(boolean notEmpty)
Note that this has different meanings for different datatypes
notEmpty - true when the value can't be empty; or
false when the value can be empty.
ConstrainedPropertyisNotEmpty()public void setNotEmpty(boolean notEmpty)
notEmpty(boolean)public boolean isNotEmpty()
true when the value can't be empty; or
false when the value can be empty.
notEmpty(boolean)public T notEqual(boolean reference)
boolean reference value.
reference - the reference value it will be checked against
ConstrainedPropertyisNotEqual()public T notEqual(byte reference)
byte reference value.
notEqual(boolean)public T notEqual(char reference)
char reference value.
notEqual(boolean)public T notEqual(short reference)
short reference value.
notEqual(boolean)public T notEqual(int reference)
int reference value.
notEqual(boolean)public T notEqual(long reference)
long reference value.
notEqual(boolean)public T notEqual(float reference)
float reference value.
notEqual(boolean)public T notEqual(double reference)
double reference value.
notEqual(boolean)public T notEqual(Object reference)
Object reference value.
notEqual(boolean)public void setNotEqual(boolean reference)
boolean reference value.
notEqual(boolean)public void setNotEqual(byte reference)
byte reference value.
notEqual(boolean)public void setNotEqual(char reference)
char reference value.
notEqual(boolean)public void setNotEqual(short reference)
short reference value.
notEqual(boolean)public void setNotEqual(int reference)
int reference value.
notEqual(boolean)public void setNotEqual(long reference)
long reference value.
notEqual(boolean)public void setNotEqual(float reference)
float reference value.
notEqual(boolean)public void setNotEqual(double reference)
double reference value.
notEqual(boolean)public void setNotEqual(Object reference)
Object reference value.
notEqual(boolean)public boolean isNotEqual()
true when the value can't be equal; or
false when the value can be equal.
notEqual(boolean)public Object getNotEqual()
null when the property has no notEqual constraint.
notEqual(boolean)public T unique(boolean unique)
Note that this is only applicable to contexts where a collection of the data is stored an that uniqueness can apply against the other entries. In a singular context, uniqueness is always guaranteed.
unique - true when the value has to be unique; or
false when it doesn't have to be.
ConstrainedPropertyisUnique()public void setUnique(boolean unique)
unique(boolean)public boolean isUnique()
true when the value has to be unique; or
false it doesn't have to be.
unique(boolean)public T identifier(boolean identifier)
Note that this is only applicable to contexts where a collection of the data is stored an that identification can apply against the other entries. In a singular context, identification is meaningless.
identifier - true when the value is an
identifier; or false when it isn't.
ConstrainedPropertyisIdentifier()public void setIdentifier(boolean identifier)
identifier(boolean)public boolean isIdentifier()
true when the property is an identifier; or
false it isn't.
identifier(boolean)public T editable(boolean editable)
public void setEditable(boolean editable)
public boolean isEditable()
public T persistent(boolean persistent)
public void setPersistent(boolean persistent)
public boolean isPersistent()
public T saved(boolean saved)
public void setSaved(boolean saved)
public boolean isSaved()
public T displayedRaw(boolean displayedRaw)
public void setDisplayedRaw(boolean displayedRaw)
public boolean isDisplayedRaw()
public boolean hasLimitedLength()
public boolean hasMixLength()
public boolean hasMaxLength()
public T minLength(int minLength)
public void setMinLength(int minLength)
public int getMinLength()
public T maxLength(int maxLength)
public void setMaxLength(int maxLength)
public int getMaxLength()
public boolean hasPrecision()
public T precision(int precision)
public void setPrecision(int precision)
public int getPrecision()
public boolean hasScale()
public T scale(int scale)
public void setScale(int scale)
public int getScale()
public T regexp(String regexp)
public void setRegexp(String regexp)
public String getRegexp()
public boolean matchesRegexp()
public T email(boolean email)
public void setEmail(boolean email)
public boolean isEmail()
public T url(boolean url)
public void setUrl(boolean url)
public boolean isUrl()
public T minDate(Date minDate)
public void setMinDate(Date minDate)
public Date getMinDate()
public T maxDate(Date maxDate)
public void setMaxDate(Date maxDate)
public Date getMaxDate()
public boolean isLimitedDate()
public T inList(String... inList)
public void setInList(String... inList)
public T inList(int... inList)
public void setInList(int... inList)
public T inList(byte... inList)
public void setInList(byte... inList)
public T inList(char... inList)
public void setInList(char... inList)
public T inList(short... inList)
public void setInList(short... inList)
public T inList(long... inList)
public void setInList(long... inList)
public T inList(float... inList)
public void setInList(float... inList)
public T inList(double... inList)
public void setInList(double... inList)
public T inList(Collection inList)
public void setInList(Collection inList)
public String[] getInList()
public boolean isInList()
public T rangeBegin(byte value)
public T rangeBegin(char value)
public T rangeBegin(short value)
public T rangeBegin(int value)
public T rangeBegin(long value)
public T rangeBegin(float value)
public T rangeBegin(double value)
public T rangeBegin(Comparable value)
public void setRangeBegin(byte value)
public void setRangeBegin(char value)
public void setRangeBegin(short value)
public void setRangeBegin(int value)
public void setRangeBegin(long value)
public void setRangeBegin(float value)
public void setRangeBegin(double value)
public void setRangeBegin(Comparable rangeBegin)
public Comparable getRangeBegin()
public T rangeEnd(char value)
public T rangeEnd(byte value)
public T rangeEnd(double value)
public T rangeEnd(float value)
public T rangeEnd(int value)
public T rangeEnd(long value)
public T rangeEnd(short value)
public T rangeEnd(Comparable value)
public void setRangeEnd(byte value)
public void setRangeEnd(char value)
public void setRangeEnd(short value)
public void setRangeEnd(int value)
public void setRangeEnd(long value)
public void setRangeEnd(float value)
public void setRangeEnd(double value)
public void setRangeEnd(Comparable rangeEnd)
public Comparable getRangeEnd()
public boolean isRange()
public T defaultValue(boolean value)
public T defaultValue(char value)
public T defaultValue(byte value)
public T defaultValue(short value)
public T defaultValue(int value)
public T defaultValue(long value)
public T defaultValue(float value)
public T defaultValue(double value)
public T defaultValue(Object value)
public void setDefaultValue(Object value)
public Object getDefaultValue()
public boolean hasDefaultValue()
public T sameAs(String reference)
public void setSameAs(String reference)
public String getSameAs()
public boolean isSameAs()
public void setManyToOne()
public void setManyToOne(Class klass)
public void setManyToOne(Class klass,
String columnReference)
public void setManyToOne(String table,
String columnReference)
public void setManyToOne(Class klass,
String columnReference,
CreateTable.ViolationAction onUpdate,
CreateTable.ViolationAction onDelete)
public void setManyToOne(String table,
String columnReference,
CreateTable.ViolationAction onUpdate,
CreateTable.ViolationAction onDelete)
public ConstrainedProperty.ManyToOne getManyToOne()
public T manyToOne()
public T manyToOne(Class klass)
public T manyToOne(Class klass,
String columnReference)
public T manyToOne(String table,
String columnReference)
public T manyToOne(Class klass,
String columnReference,
CreateTable.ViolationAction onUpdate,
CreateTable.ViolationAction onDelete)
public T manyToOne(String table,
String columnReference,
CreateTable.ViolationAction onUpdate,
CreateTable.ViolationAction onDelete)
public boolean hasManyToOne()
public void setManyToOneAssociation()
public void setManyToOneAssociation(String property)
public void setManyToOneAssociation(Class klass,
String property)
public ConstrainedProperty.ManyToOneAssociation getManyToOneAssociation()
public T manyToOneAssociation()
public T manyToOneAssociation(String property)
public T manyToOneAssociation(Class klass,
String property)
public boolean hasManyToOneAssociation()
public void setManyToMany()
public void setManyToMany(Class klass)
public void setManyToMany(CreateTable.ViolationAction onUpdate,
CreateTable.ViolationAction onDelete)
public void setManyToMany(Class klass,
CreateTable.ViolationAction onUpdate,
CreateTable.ViolationAction onDelete)
public ConstrainedProperty.ManyToMany getManyToMany()
public T manyToMany()
public T manyToMany(Class klass)
public T manyToMany(CreateTable.ViolationAction onUpdate,
CreateTable.ViolationAction onDelete)
public T manyToMany(Class klass,
CreateTable.ViolationAction onUpdate,
CreateTable.ViolationAction onDelete)
public boolean hasManyToMany()
public void setManyToManyAssociation()
public void setManyToManyAssociation(String property)
public void setManyToManyAssociation(Class klass,
String property)
public ConstrainedProperty.ManyToManyAssociation getManyToManyAssociation()
public T manyToManyAssociation()
public T manyToManyAssociation(String property)
public T manyToManyAssociation(Class klass,
String property)
public boolean hasManyToManyAssociation()
public T format(Format format)
public void setFormat(Format format)
public Format getFormat()
public boolean isFormatted()
public T file(boolean file)
public void setFile(boolean file)
public boolean isFile()
public T sparse(boolean sparse)
public void setSparse(boolean sparse)
public boolean isSparse()
public T listed(boolean listed)
This is not actually used by the CMF itself, but is very useful when integrating with automatic user interface generation libraries.
listed - true if the property should be listed; or
false if it shouldn't
ConstrainedProperty instancesetListed(boolean),
isListed()public void setListed(boolean listed)
listed - true if the property should be listed; or
false if it shouldn't
listed(boolean),
isListed()public boolean isListed()
true if the property should be listed; or
false if it shouldn't
listed(boolean),
setListed(boolean)public T position(int position)
This is not actually used by the CMF itself, but is very useful when integrating with automatic user interface generation libraries.
position - an integer value with the position; or
-1 if the property shouldn't be positioned
ConstrainedProperty instancesetPosition(int),
hasPosition(),
getPosition()public void setPosition(int position)
position - an integer value with the position; or
-1 if the property shouldn't be positioned
position(int),
hasPosition(),
getPosition()public boolean hasPosition()
true if the property has a position; or
false if it hasn't
position(int),
setPosition(int),
getPosition()public int getPosition()
-1 if the property shouldn't be positioned
position(int),
setPosition(int),
hasPosition()public T mimeType(MimeType mimeType)
Setting this constraint will make the ContentQueryManager
automatically store the data in this property in the content management
back-end. This column will not be stored in a regular database table.
All this is handled transparently and automatically.
mimeType - the MimeType of the property
ConstrainedProperty instancesetMimeType(MimeType),
hasMimeType(),
getMimeType()public void setMimeType(MimeType mimeType)
mimeType - the MimeType of the propertymimeType(MimeType),
hasMimeType(),
getMimeType()public boolean hasMimeType()
true if the property has a mime type; or
false if it hasn't
mimeType(MimeType),
setMimeType(MimeType),
getMimeType()public MimeType getMimeType()
null if the property has no mime type
mimeType(MimeType),
setMimeType(MimeType),
hasMimeType()public T autoRetrieved(boolean autoRetrieved)
This is only useful when the property also has a mime type constraint.
It's not recommended to enable this constraint for large data since everything will be stored in memory, only use this for text snippets or something relatively small.
autoRetrieved - true if the data should be
automatically retrieved; or
false otherwise
ConstrainedProperty instancemimeType(MimeType),
setAutoRetrieved(boolean),
isAutoRetrieved()public void setAutoRetrieved(boolean autoRetrieved)
autoRetrieved - true if the data should be
automatically retrieved; or
false otherwise
autoRetrieved(boolean),
isAutoRetrieved()public boolean isAutoRetrieved()
true if the data should be automatically
retrieved; or
false otherwise
autoRetrieved(boolean),
setAutoRetrieved(boolean)public T fragment(boolean fragment)
This is only useful when the property also has a mime type constraint. A fragment means that it's not a complete document or a file, but rather a small part that is intended to be used within a larger document. For example a HTML snippet. This information is for example important when validating the data.
fragment - true if the content is a fragment; or
false otherwise
ConstrainedProperty instancemimeType(MimeType),
setFragment(boolean),
isFragment()public void setFragment(boolean fragment)
fragment - true if the content is a fragment; or
false otherwise
fragment(boolean),
isFragment()public boolean isFragment()
true if the content is a fragment; or
false otherwise
fragment(boolean),
setFragment(boolean)public T name(String name)
This is only useful when the property also has a mime type constraint.
name - the name
ConstrainedProperty instancemimeType(MimeType),
setName(String),
getName(),
hasName()public void setName(String name)
name - the namename(String),
getName(),
hasName()public String getName()
null if the content data has no name; or
the name of the content
name(String),
setName(String),
hasName()public boolean hasName()
true if the property has a name; or
false otherwise
name(String),
setName(String),
getName()public T repository(String repository)
This is only useful when the property also has a mime type constraint.
repository - the repository
CmrProperty instancemimeType(MimeType),
setRepository(String),
getRepository(),
hasRepository()public void setRepository(String repository)
repository - the repositoryrepository(String),
getRepository(),
hasRepository()public String getRepository()
null if no repository has been specified; or
the name of the repository
repository(String),
setRepository(String),
hasRepository()public boolean hasRepository()
true if the property will be stored in another
repository; or
false otherwise
repository(String),
setRepository(String),
getRepository()public T ordinal(boolean ordinal)
The value of this property will be handled in the back-end by an
OrdinalManager. It will
also enable the move, up
and down methods in the ContentQueryManager to easily reorder data rows in the back-end.
ordinal - true if this property is an ordinal; or
false otherwise
ConstrainedProperty instanceordinal(boolean, String),
setOrdinal(boolean),
setOrdinal(boolean, String),
isOrdinal()
public T ordinal(boolean ordinal,
String restriction)
ordinal - true if this property is an ordinal; or
false otherwise
restriction - the name of the restricting column
ConstrainedProperty instanceordinal(boolean),
setOrdinal(boolean),
setOrdinal(boolean, String),
isOrdinal(),
hasOrdinalRestriction(),
getOrdinalRestriction()public void setOrdinal(boolean ordinal)
ordinal - true if this property is an ordinal; or
false otherwise
ordinal(boolean),
ordinal(boolean, String),
setOrdinal(boolean, String),
isOrdinal()
public void setOrdinal(boolean ordinal,
String restriction)
ordinal - true if this property is an ordinal; or
false otherwise
restriction - the name of the restricting columnordinal(boolean),
ordinal(boolean, String),
setOrdinal(boolean),
isOrdinal(),
hasOrdinalRestriction(),
getOrdinalRestriction()public boolean isOrdinal()
true if this property is an ordinal; or
false otherwise
ordinal(boolean),
ordinal(boolean, String),
setOrdinal(boolean),
setOrdinal(boolean, String)public boolean hasOrdinalRestriction()
true if this property has an ordinal restricting
column; or
false otherwise
ordinal(boolean, String),
setOrdinal(boolean, String),
getOrdinalRestriction()public String getOrdinalRestriction()
null if no ordinal restricting column has been defined
ordinal(boolean, String),
setOrdinal(boolean, String),
hasOrdinalRestriction()
public T contentAttribute(String name,
boolean value)
String value.
name - the name of the attributevalue - the value of the attribute
Content instancecontentAttribute(String, String),
getContentAttributes()
public T contentAttribute(String name,
char value)
String value.
name - the name of the attributevalue - the value of the attribute
Content instancecontentAttribute(String, String),
getContentAttributes()
public T contentAttribute(String name,
byte value)
String value.
name - the name of the attributevalue - the value of the attribute
Content instancecontentAttribute(String, String),
getContentAttributes()
public T contentAttribute(String name,
short value)
String value.
name - the name of the attributevalue - the value of the attribute
Content instancecontentAttribute(String, String),
getContentAttributes()
public T contentAttribute(String name,
int value)
String value.
name - the name of the attributevalue - the value of the attribute
Content instancecontentAttribute(String, String),
getContentAttributes()
public T contentAttribute(String name,
long value)
String value.
name - the name of the attributevalue - the value of the attribute
Content instancecontentAttribute(String, String),
getContentAttributes()
public T contentAttribute(String name,
float value)
String value.
name - the name of the attributevalue - the value of the attribute
Content instancecontentAttribute(String, String),
getContentAttributes()
public T contentAttribute(String name,
double value)
String value.
name - the name of the attributevalue - the value of the attribute
Content instancecontentAttribute(String, String),
getContentAttributes()
public T contentAttribute(String name,
String value)
This is only useful when the property also has a mime type constraint.
A content attribute provides additional meta data about how you want to store the content data after loading, this can for example be image dimensions.
name - the name of the attributevalue - the value of the attribute
Content instancemimeType(MimeType),
getContentAttributes()public Map<String,String> getContentAttributes()
null if no attributes are present
contentAttribute(String, String)public T transformer(ContentTransformer transformer)
This is only useful when the property also has a mime type constraint.
transformer - the content transformer
Content instancemimeType(MimeType),
setTransformer(ContentTransformer),
hasTransformer(),
getTransformer()public void setTransformer(ContentTransformer transformer)
transformer - the content transformermimeType(MimeType),
transformer(ContentTransformer),
hasTransformer(),
getTransformer()public boolean hasTransformer()
true if this property has a content transformer;
or
false otherwise
transformer(ContentTransformer),
setTransformer(ContentTransformer),
getTransformer()public ContentTransformer getTransformer()
null if no content transformer has been defined
transformer(ContentTransformer),
setTransformer(ContentTransformer),
hasTransformer()public void setCachedLoadedData(Object data)
This is used internally and should never be used explicitly by a
developer, see Content.cachedLoadedData(Object) for more information.
data - the loaded datagetCachedLoadedData()public Object getCachedLoadedData()
null if no loaded content data has been cached
setCachedLoadedData(Object)
public void setConstraint(String name,
Object constraintData)
Note that it's not recommended to use this to set any of the standard constraints since none of the additional logic and checks are executed.
constraint(java.lang.String, java.lang.Object),
getConstraint(java.lang.String),
getConstraints()
public T constraint(String name,
Object constraintData)
Note that it's not recommended to use this to set any of the standard constraints since none of the additional logic and checks are executed.
Content instancesetConstraint(java.lang.String, java.lang.Object),
getConstraint(java.lang.String),
getConstraints()public Object getConstraint(String name)
null if nothing has been registered for
that constraint
setConstraint(java.lang.String, java.lang.Object),
constraint(java.lang.String, java.lang.Object),
getConstraints()public Map<String,Object> getConstraints()
setConstraint(java.lang.String, java.lang.Object),
constraint(java.lang.String, java.lang.Object),
getConstraint(java.lang.String)public ConstrainedProperty clone()
clone in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||