org.xwiki.properties.internal
Class DefaultPropertyDescriptor

java.lang.Object
  extended by org.xwiki.properties.internal.DefaultPropertyDescriptor
All Implemented Interfaces:
PropertyDescriptor

public class DefaultPropertyDescriptor
extends java.lang.Object
implements PropertyDescriptor

Default implementation for PropertyDescriptor.

Since:
2.0M2
Version:
$Id$

Constructor Summary
DefaultPropertyDescriptor()
           
 
Method Summary
 java.lang.Object getDefaultValue()
          
 java.lang.String getDescription()
          
 java.lang.reflect.Field getFied()
          
 java.lang.String getId()
          
 java.lang.String getName()
          
 java.lang.Class<?> getPropertyClass()
          Deprecated. 
 java.lang.reflect.Type getPropertyType()
          
 java.lang.reflect.Method getReadMethod()
          
 java.lang.reflect.Method getWriteMethod()
          
 boolean isMandatory()
          
 void setDefaultValue(java.lang.Object defaultValue)
           
 void setDescription(java.lang.String description)
           
 void setField(java.lang.reflect.Field field)
           
 void setId(java.lang.String id)
           
 void setMandatory(boolean mandatory)
           
 void setName(java.lang.String name)
           
 void setPropertyType(java.lang.reflect.Type propertyType)
           
 void setReadMethod(java.lang.reflect.Method readMethod)
           
 void setWriteMethod(java.lang.reflect.Method writeMethod)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPropertyDescriptor

public DefaultPropertyDescriptor()
Method Detail

getId

public java.lang.String getId()

Specified by:
getId in interface PropertyDescriptor
Returns:
the identifier of the property.
See Also:
PropertyDescriptor.getId()

setId

public void setId(java.lang.String id)
Parameters:
id - the identifier of the property.
Since:
2.1M1
See Also:
getId()

getName

public java.lang.String getName()

Specified by:
getName in interface PropertyDescriptor
Returns:
the display name of the property.
See Also:
PropertyDescriptor.getName()

setName

public void setName(java.lang.String name)
Parameters:
name - the display name of the property.
Since:
2.1M1
See Also:
getName()

getDescription

public java.lang.String getDescription()

Specified by:
getDescription in interface PropertyDescriptor
Returns:
the description of the property.
See Also:
PropertyDescriptor.getDescription()

setDescription

public void setDescription(java.lang.String description)
Parameters:
description - the description of the property.
See Also:
getDescription()

getPropertyClass

@Deprecated
public java.lang.Class<?> getPropertyClass()
Deprecated. 

Specified by:
getPropertyClass in interface PropertyDescriptor
Returns:
the type of the property.
See Also:
PropertyDescriptor.getPropertyClass()

getPropertyType

public java.lang.reflect.Type getPropertyType()

Specified by:
getPropertyType in interface PropertyDescriptor
Returns:
the type of the property.
See Also:
PropertyDescriptor.getPropertyType()

setPropertyType

public void setPropertyType(java.lang.reflect.Type propertyType)
Parameters:
propertyType - the class of the property.
See Also:
getPropertyClass()

getDefaultValue

public java.lang.Object getDefaultValue()

Specified by:
getDefaultValue in interface PropertyDescriptor
Returns:
the default value of the property.
See Also:
PropertyDescriptor.getDefaultValue()

setDefaultValue

public void setDefaultValue(java.lang.Object defaultValue)
Parameters:
defaultValue - the default value of the property.
See Also:
getDefaultValue()

isMandatory

public boolean isMandatory()

Specified by:
isMandatory in interface PropertyDescriptor
Returns:
indicate if the property is mandatory.
See Also:
PropertyDescriptor.isMandatory()

setMandatory

public void setMandatory(boolean mandatory)
Parameters:
mandatory - indicate if the property is mandatory.
See Also:
isMandatory()

setField

public void setField(java.lang.reflect.Field field)
Parameters:
field - the Field.
See Also:
PropertyDescriptor.getFied().

getFied

public java.lang.reflect.Field getFied()

Specified by:
getFied in interface PropertyDescriptor
Returns:
the field. If null if generally mean that the property is based on getter/setter.
See Also:
PropertyDescriptor.getFied()

setReadMethod

public void setReadMethod(java.lang.reflect.Method readMethod)
Parameters:
readMethod - the read Method.
See Also:
PropertyDescriptor.getReadMethod().

getReadMethod

public java.lang.reflect.Method getReadMethod()

Specified by:
getReadMethod in interface PropertyDescriptor
Returns:
the read method. If null it generally mean that the property is a public field.
See Also:
PropertyDescriptor.getReadMethod()

setWriteMethod

public void setWriteMethod(java.lang.reflect.Method writeMethod)
Parameters:
writeMethod - the write Method.
See Also:
PropertyDescriptor.getWriteMethod().

getWriteMethod

public java.lang.reflect.Method getWriteMethod()

Specified by:
getWriteMethod in interface PropertyDescriptor
Returns:
the write method. If null it generally mean that the property is a public field.
See Also:
PropertyDescriptor.getWriteMethod()


Copyright © 2004-2011 XWiki. All Rights Reserved.