org.apache.bval.model
Class MetaProperty

java.lang.Object
  extended by org.apache.bval.model.FeaturesCapable
      extended by org.apache.bval.model.MetaProperty
All Implemented Interfaces:
Serializable, Cloneable, Features.Property

public class MetaProperty
extends FeaturesCapable
implements Cloneable, Features.Property

Description: the meta description of a property of a bean. It supports a map of features and multiple validations.

See Also:
Validation, MetaBean, Serialized Form

Field Summary
 
Fields inherited from interface org.apache.bval.model.Features.Property
DEFAULT_VALUE, DENIED, ENUM, HIDDEN, JAVASCRIPT_VALIDATION_FUNCTIONS, MANDATORY, MAX_LENGTH, MAX_VALUE, MIN_LENGTH, MIN_VALUE, PREFERRED, READONLY, REF_BEAN_ID, REF_BEAN_TYPE, REF_CASCADE, REG_EXP, TIME_LAG, UNIQUE_KEY
 
Constructor Summary
MetaProperty()
          Create a new MetaProperty instance.
 
Method Summary
 MetaProperty clone()
          
 String[] getJavaScriptValidations()
          Deprecated.  
 MetaBean getMetaBean()
          Get the metabean of the target bean (mainly for relationships).
 String getName()
          Get the name of this property.
 MetaBean getParentMetaBean()
          Get the metabean that owns this property (set by MetaBean.putProperty())
 Type getType()
          Get the type of this property.
 Class<?> getTypeClass()
          Resolve the type of this property to a class.
 boolean isMandatory()
          Learn whether this property is considered mandatory.
 boolean isRelationship()
          Learn whether this property is considered a relationship.
 void setMandatory(boolean mandatory)
          Set this property as being mandatory (or not).
 void setMetaBean(MetaBean metaBean)
          Set the MetaBean of this MetaProperty.
 void setName(String name)
          Set the name of this property.
(package private)  void setParentMetaBean(MetaBean parentMetaBean)
          Set the metabean that owns this property (usually called by MetaBean.putProperty())
 void setType(Type type)
          Set the type of this property.
 String toString()
          
 
Methods inherited from class org.apache.bval.model.FeaturesCapable
addValidation, copy, copyInto, createFeaturesMap, getFeature, getFeature, getFeatures, getValidations, hasValidation, optimizeRead, putFeature, setValidations
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MetaProperty

public MetaProperty()
Create a new MetaProperty instance.

Method Detail

getMetaBean

public MetaBean getMetaBean()
Get the metabean of the target bean (mainly for relationships).

Returns:
MetaBean (may be null).

setMetaBean

public void setMetaBean(MetaBean metaBean)
Set the MetaBean of this MetaProperty.

Parameters:
metaBean - to set

getParentMetaBean

public MetaBean getParentMetaBean()
Get the metabean that owns this property (set by MetaBean.putProperty())

Returns:

setParentMetaBean

void setParentMetaBean(MetaBean parentMetaBean)
Set the metabean that owns this property (usually called by MetaBean.putProperty())

Parameters:
parentMetaBean -

isRelationship

public boolean isRelationship()
Learn whether this property is considered a relationship.

Returns:
true if it has a MetaBean of its own

setType

public void setType(Type type)
Set the type of this property.

Parameters:
type - to set

getType

public Type getType()
Get the type of this property.

Returns:

getTypeClass

public Class<?> getTypeClass()
Resolve the type of this property to a class.

Returns:
Class, null if cannot be determined

getName

public String getName()
Get the name of this property.

Returns:
String

isMandatory

public boolean isMandatory()
Learn whether this property is considered mandatory.

Returns:
true if the MANDATORY feature is set to true.
See Also:
Features.Property#MANDATORY}

setMandatory

public void setMandatory(boolean mandatory)
Set this property as being mandatory (or not).

Parameters:
mandatory -
See Also:
Features.Property#MANDATORY}

getJavaScriptValidations

@Deprecated
public String[] getJavaScriptValidations()
Deprecated. 

Get javascript validations of this property.

Returns:
String[]

setName

public void setName(String name)
Set the name of this property.

Parameters:
name - to set

clone

public MetaProperty clone()
                   throws CloneNotSupportedException

Overrides:
clone in class Object
Throws:
CloneNotSupportedException

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2010-2012 Apache Software Foundation. All Rights Reserved.