com.wewebu.ow.server.field
Class OwStandardDecoratorFieldDefinition

java.lang.Object
  extended by com.wewebu.ow.server.field.OwStandardDecoratorFieldDefinition
All Implemented Interfaces:
OwFieldDefinition

public abstract class OwStandardDecoratorFieldDefinition
extends Object
implements OwFieldDefinition

OwFieldDefinition wrapper to implement a decorator pattern.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Constructor Summary
OwStandardDecoratorFieldDefinition()
           
 
Method Summary
 String getClassName()
          get the name of the class
 List getComplexChildClasses()
          get child properties classes of a complex property class
 Object getDefaultValue()
          get the default value
 String getDescription(Locale locale_p)
          get the description defined by the DMS System
 String getDisplayName(Locale locale_p)
          get the displayable name of the type as defined by the DMS System can be identical to getClassName
 OwEnumCollection getEnums()
          get a list of enum objects for the enum type (see isEnum)
 OwFormat getFormat()
          get the formatter object for string representation
 String getJavaClassName()
          get the java class name of java object associated with this property
 Object getMaxValue()
          get the max allowed value, or Integer len for String or null if not defined
 Object getMinValue()
          get the min allowed value, or Integer len for String or null if not defined
 Object getNativeType()
          get the native type which is defined by the underlying system WARNING: The returned object is opaque.
 Node getNodeFromValue(Object value_p, Document doc_p)
          create a XML serialization of the given field value
 Collection getOperators()
          get a collection of possible filter / search operators for the field
 Object getValueFromNode(Node node_p)
          create a value for the field described by this class with the given XML Node serialization
 Object getValueFromString(String text_p)
          create a value for the field described by this class with the given String serialization
abstract  OwFieldDefinition getWrappedFieldDefinition()
          get the decorated object, to be implemented be overridden classes
 boolean isArray()
          check if property contains a list of values
 boolean isComplex()
          check if the property is a component that contains another child properties
 boolean isEnum()
          check if property is a enum type (see getEnums)
 boolean isRequired()
          check if property is required, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OwStandardDecoratorFieldDefinition

public OwStandardDecoratorFieldDefinition()
Method Detail

getWrappedFieldDefinition

public abstract OwFieldDefinition getWrappedFieldDefinition()
get the decorated object, to be implemented be overridden classes


getClassName

public String getClassName()
Description copied from interface: OwFieldDefinition
get the name of the class

Specified by:
getClassName in interface OwFieldDefinition
Returns:
class name

getComplexChildClasses

public List getComplexChildClasses()
                            throws Exception
Description copied from interface: OwFieldDefinition
get child properties classes of a complex property class

Specified by:
getComplexChildClasses in interface OwFieldDefinition
Returns:
Collection of OwFieldDefinition or null if isComplex is false
Throws:
Exception
See Also:
OwFieldDefinition.isComplex()

getDefaultValue

public Object getDefaultValue()
                       throws Exception
Description copied from interface: OwFieldDefinition
get the default value

Specified by:
getDefaultValue in interface OwFieldDefinition
Throws:
Exception

getDescription

public String getDescription(Locale locale_p)
Description copied from interface: OwFieldDefinition
get the description defined by the DMS System

Specified by:
getDescription in interface OwFieldDefinition
Parameters:
locale_p - Locale to use
Returns:
type description of property

getDisplayName

public String getDisplayName(Locale locale_p)
Description copied from interface: OwFieldDefinition
get the displayable name of the type as defined by the DMS System can be identical to getClassName

Specified by:
getDisplayName in interface OwFieldDefinition
Parameters:
locale_p - Locale to use
Returns:
type displayable name of property

getEnums

public OwEnumCollection getEnums()
                          throws Exception
Description copied from interface: OwFieldDefinition
get a list of enum objects for the enum type (see isEnum)

Specified by:
getEnums in interface OwFieldDefinition
Returns:
OwEnumCollection of OwEnum objects, which can be used in a select box.
Throws:
Exception

getFormat

public OwFormat getFormat()
Description copied from interface: OwFieldDefinition
get the formatter object for string representation

Specified by:
getFormat in interface OwFieldDefinition
Returns:
OwFormat, can be null to use the default format

getJavaClassName

public String getJavaClassName()
Description copied from interface: OwFieldDefinition
get the java class name of java object associated with this property

Specified by:
getJavaClassName in interface OwFieldDefinition
Returns:
java class name

getMaxValue

public Object getMaxValue()
                   throws Exception
Description copied from interface: OwFieldDefinition
get the max allowed value, or Integer len for String or null if not defined

Specified by:
getMaxValue in interface OwFieldDefinition
Throws:
Exception

getMinValue

public Object getMinValue()
                   throws Exception
Description copied from interface: OwFieldDefinition
get the min allowed value, or Integer len for String or null if not defined

Specified by:
getMinValue in interface OwFieldDefinition
Throws:
Exception

getNativeType

public Object getNativeType()
                     throws Exception
Description copied from interface: OwFieldDefinition
get the native type which is defined by the underlying system WARNING: The returned object is opaque. Using this object makes the client dependent on the underlying system

Specified by:
getNativeType in interface OwFieldDefinition
Returns:
Object native Type Object
Throws:
Exception

getNodeFromValue

public Node getNodeFromValue(Object value_p,
                             Document doc_p)
                      throws Exception
Description copied from interface: OwFieldDefinition
create a XML serialization of the given field value

Specified by:
getNodeFromValue in interface OwFieldDefinition
Parameters:
value_p - Object with field value
doc_p - DOM Document to add to
Returns:
DOM Node
Throws:
Exception

getOperators

public Collection getOperators()
                        throws Exception
Description copied from interface: OwFieldDefinition
get a collection of possible filter / search operators for the field

Specified by:
getOperators in interface OwFieldDefinition
Returns:
Collection of operators as defined with OwSearchOperator.CRIT_OP_..., or null if no operators are defined
Throws:
Exception

getValueFromNode

public Object getValueFromNode(Node node_p)
                        throws Exception
Description copied from interface: OwFieldDefinition
create a value for the field described by this class with the given XML Node serialization

Specified by:
getValueFromNode in interface OwFieldDefinition
Parameters:
node_p - the serialized value as a XML DOM Node
Returns:
Object the value of the field
Throws:
Exception

getValueFromString

public Object getValueFromString(String text_p)
                          throws Exception
Description copied from interface: OwFieldDefinition
create a value for the field described by this class with the given String serialization

Specified by:
getValueFromString in interface OwFieldDefinition
Parameters:
text_p - String the serialized value
Returns:
Object the value of the field
Throws:
Exception

isArray

public boolean isArray()
                throws Exception
Description copied from interface: OwFieldDefinition
check if property contains a list of values

Specified by:
isArray in interface OwFieldDefinition
Returns:
true if property is array, false if property is scalar
Throws:
Exception

isComplex

public boolean isComplex()
Description copied from interface: OwFieldDefinition
check if the property is a component that contains another child properties

Specified by:
isComplex in interface OwFieldDefinition
Returns:
true if the property can contains child properties
See Also:
OwFieldDefinition.getComplexChildClasses()

isEnum

public boolean isEnum()
               throws Exception
Description copied from interface: OwFieldDefinition
check if property is a enum type (see getEnums)

Specified by:
isEnum in interface OwFieldDefinition
Returns:
true if property is a enum type
Throws:
Exception

isRequired

public boolean isRequired()
                   throws Exception
Description copied from interface: OwFieldDefinition
check if property is required, i.e. must be set by the user

Specified by:
isRequired in interface OwFieldDefinition
Returns:
true if property is required
Throws:
Exception


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.