com.wewebu.ow.server.field
Class OwStandardDecoratorSearchCriteria

java.lang.Object
  extended by com.wewebu.ow.server.field.OwSearchCriteria
      extended by com.wewebu.ow.server.field.OwStandardDecoratorSearchCriteria
All Implemented Interfaces:
OwField, OwFieldDefinition, OwFormat
Direct Known Subclasses:
OwStandardCrossMappings.OwCrossDecoratorSearchNode.OwWrappedSearchCriteria

public abstract class OwStandardDecoratorSearchCriteria
extends OwSearchCriteria

OwSearchCriteria 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


Field Summary
 
Fields inherited from class com.wewebu.ow.server.field.OwSearchCriteria
ATTRIBUTE_ALLOWWILDCARD, ATTRIBUTE_HIDDEN, ATTRIBUTE_IGNORE_DATE, ATTRIBUTE_IGNORE_TIME, ATTRIBUTE_NONE, ATTRIBUTE_READONLY, ATTRIBUTE_REQUIRED, m_FieldDefinition, m_iAttributes, m_iOp, m_oDefaultValue, m_oValue, m_secondrangecriteria, m_strInstruction, m_strUniqueName, m_wildcarddefinitions
 
Constructor Summary
OwStandardDecoratorSearchCriteria()
           
 
Method Summary
 boolean canWildCard()
          check if criteria allows the use of wildcards
 int getAttributes()
          get the flag indicating if the criteria can be edited in a search template view or if it is hidden
 String getClassName()
          get the name of the class
 Object getDefaultValue()
          get the default search 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)
 OwFieldDefinition getFieldDefinition()
          get the corresponding field definition of the field
 OwFormat getFormat()
          get the formatter object for string representation
 String getInstruction()
          get the instruction to the search criteria
 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
 int getOperator()
          get the criteria operator which should be applied to the value as defined in OwSearchCriteria
 String getOperatorDisplayName(Locale locale_p)
          convert a operator ID to a displayable name
 Collection getOperators()
          get a collection of possible filter / search operators for the field
 String getOriginalJavaClassName()
          get the original class name, in case data type was overridden by allow wildcard
 OwSearchCriteria getSecondRangeCriteria()
          get a optional second child criteria for range searches
 Format getTextFormat(int fieldProviderType_p)
          get the optional formatter object for string representation, according to the given context type
 String getUniqueName()
          get a unique name that identifies this criteria
 Object getValue()
          get the compare value for the search
 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
 Collection getWildCardDefinitions()
          get the wildcard definitions for this criteria
abstract  OwSearchCriteria getWrappedCriteria()
          get the decorated object, to be implemented be overridden classes
 boolean ignoreTime()
          check if the format should ignore time part of date values
 boolean isAllowWildcard()
          check if the criteria allows wildcard even if underlying type is number
 boolean isArray()
          check if property contains a list of values
 boolean isCriteriaOperatorRange()
          check if criteria has a second range criteria fo ranges
 boolean isDateType()
          check if criteria is a date criteria
 boolean isEnum()
          check if property is a enum type (see getEnums)
 boolean isHidden()
          check if the criteria can be edited in a search template view or if it is hidden
 boolean isIgnoreTime()
          check if the criteria ignores the time part
 boolean isReadonly()
          check if the criteria is visible but read-only
 boolean isRequired()
          check if the criteria must be set
 boolean isType(Class base_p)
          check if given java class name is base type
 void setInitialAndDefaultValue(Object value_p)
          set the initial/default value for the search
 void setOperator(int op_p)
          set the criteria operator which should be applied to the value as defined in OwSearchCriteria
 void setValue(Object value_p)
          set the compare value for the search
 void setWildCardDefinitions(Collection wildcarddefinitions_p)
          set the wildcard definitions for this criteria
 
Methods inherited from class com.wewebu.ow.server.field.OwSearchCriteria
canValidate, getComplexChildClasses, ignoreDate, isComplex, isIgnoreDate, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OwStandardDecoratorSearchCriteria

public OwStandardDecoratorSearchCriteria()
Method Detail

getWrappedCriteria

public abstract OwSearchCriteria getWrappedCriteria()
get the decorated object, to be implemented be overridden classes


canWildCard

public boolean canWildCard()
Description copied from class: OwSearchCriteria
check if criteria allows the use of wildcards

Overrides:
canWildCard in class OwSearchCriteria

getAttributes

public int getAttributes()
Description copied from class: OwSearchCriteria
get the flag indicating if the criteria can be edited in a search template view or if it is hidden

Overrides:
getAttributes in class OwSearchCriteria

getClassName

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

Specified by:
getClassName in interface OwFieldDefinition
Overrides:
getClassName in class OwSearchCriteria
Returns:
class name

getDefaultValue

public Object getDefaultValue()
                       throws Exception
Description copied from class: OwSearchCriteria
get the default search value

Specified by:
getDefaultValue in interface OwFieldDefinition
Overrides:
getDefaultValue in class OwSearchCriteria
Returns:
Object for single criteria, or Object[2] for range criteria
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
Overrides:
getDescription in class OwSearchCriteria
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
Overrides:
getDisplayName in class OwSearchCriteria
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
Overrides:
getEnums in class OwSearchCriteria
Returns:
OwEnumCollection of OwEnum objects, which can be used in a select box.
Throws:
Exception

getFieldDefinition

public OwFieldDefinition getFieldDefinition()
                                     throws Exception
Description copied from class: OwSearchCriteria
get the corresponding field definition of the field

Specified by:
getFieldDefinition in interface OwField
Overrides:
getFieldDefinition in class OwSearchCriteria
Returns:
OwFieldDefinition
Throws:
Exception

getFormat

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

Specified by:
getFormat in interface OwFieldDefinition
Overrides:
getFormat in class OwSearchCriteria
Returns:
Format, can be null to use the default format

getInstruction

public String getInstruction()
Description copied from class: OwSearchCriteria
get the instruction to the search criteria

Overrides:
getInstruction in class OwSearchCriteria

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
Overrides:
getJavaClassName in class OwSearchCriteria
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
Overrides:
getMaxValue in class OwSearchCriteria
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
Overrides:
getMinValue in class OwSearchCriteria
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
Overrides:
getNativeType in class OwSearchCriteria
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
Overrides:
getNodeFromValue in class OwSearchCriteria
Parameters:
value_p - Object with field value
doc_p - DOM Document to add to
Returns:
DOM Node
Throws:
Exception

getOperator

public int getOperator()
Description copied from class: OwSearchCriteria
get the criteria operator which should be applied to the value as defined in OwSearchCriteria

Overrides:
getOperator in class OwSearchCriteria

getOperatorDisplayName

public String getOperatorDisplayName(Locale locale_p)
Description copied from class: OwSearchCriteria
convert a operator ID to a displayable name

Overrides:
getOperatorDisplayName in class OwSearchCriteria
Returns:
display name for given operator

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
Overrides:
getOperators in class OwSearchCriteria
Returns:
Collection of operators as defined with OwSearchOperator.CRIT_OP_..., or null if no operators are defined
Throws:
Exception

getOriginalJavaClassName

public String getOriginalJavaClassName()
Description copied from class: OwSearchCriteria
get the original class name, in case data type was overridden by allow wildcard

Overrides:
getOriginalJavaClassName in class OwSearchCriteria
Returns:
a String

getSecondRangeCriteria

public OwSearchCriteria getSecondRangeCriteria()
Description copied from class: OwSearchCriteria
get a optional second child criteria for range searches

Overrides:
getSecondRangeCriteria in class OwSearchCriteria

getTextFormat

public Format getTextFormat(int fieldProviderType_p)
Description copied from class: OwSearchCriteria
get the optional formatter object for string representation, according to the given context type

Specified by:
getTextFormat in interface OwFormat
Overrides:
getTextFormat in class OwSearchCriteria
Parameters:
fieldProviderType_p - int as defined in OwFieldProvider.TYPE_...
Returns:
OwFormat, can be null to use the default format

getUniqueName

public String getUniqueName()
Description copied from class: OwSearchCriteria
get a unique name that identifies this criteria

Overrides:
getUniqueName in class OwSearchCriteria
Returns:
String unique name for the criteria

getValue

public Object getValue()
Description copied from class: OwSearchCriteria
get the compare value for the search

Specified by:
getValue in interface OwField
Overrides:
getValue in class OwSearchCriteria
Returns:
Object value of field if field is scalar, or a java.io.List of objects if field is an array

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
Overrides:
getValueFromNode in class OwSearchCriteria
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 class: OwSearchCriteria
create a value for the field described by this class with the given String serialization

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

getWildCardDefinitions

public Collection getWildCardDefinitions()
Description copied from class: OwSearchCriteria
get the wildcard definitions for this criteria

Overrides:
getWildCardDefinitions in class OwSearchCriteria
Returns:
Collection of OwWildCardDefinition, or null if no wildcards are allowed

ignoreTime

public boolean ignoreTime()
Description copied from interface: OwFormat
check if the format should ignore time part of date values

Specified by:
ignoreTime in interface OwFormat
Overrides:
ignoreTime in class OwSearchCriteria

isAllowWildcard

public boolean isAllowWildcard()
Description copied from class: OwSearchCriteria
check if the criteria allows wildcard even if underlying type is number

Overrides:
isAllowWildcard in class OwSearchCriteria

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
Overrides:
isArray in class OwSearchCriteria
Returns:
true if property is array, false if property is scalar
Throws:
Exception

isCriteriaOperatorRange

public boolean isCriteriaOperatorRange()
Description copied from class: OwSearchCriteria
check if criteria has a second range criteria fo ranges

Overrides:
isCriteriaOperatorRange in class OwSearchCriteria
Returns:
boolean

isDateType

public boolean isDateType()
Description copied from class: OwSearchCriteria
check if criteria is a date criteria

Overrides:
isDateType in class OwSearchCriteria
Returns:
a boolean

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
Overrides:
isEnum in class OwSearchCriteria
Returns:
true if property is a enum type
Throws:
Exception

isHidden

public boolean isHidden()
Description copied from class: OwSearchCriteria
check if the criteria can be edited in a search template view or if it is hidden

Overrides:
isHidden in class OwSearchCriteria

isIgnoreTime

public boolean isIgnoreTime()
Description copied from class: OwSearchCriteria
check if the criteria ignores the time part

Overrides:
isIgnoreTime in class OwSearchCriteria

isReadonly

public boolean isReadonly()
Description copied from class: OwSearchCriteria
check if the criteria is visible but read-only

Overrides:
isReadonly in class OwSearchCriteria

isRequired

public boolean isRequired()
Description copied from class: OwSearchCriteria
check if the criteria must be set

Specified by:
isRequired in interface OwFieldDefinition
Overrides:
isRequired in class OwSearchCriteria
Returns:
true if property is required

isType

public boolean isType(Class base_p)
               throws ClassNotFoundException
Description copied from class: OwSearchCriteria
check if given java class name is base type

Overrides:
isType in class OwSearchCriteria
Parameters:
base_p - a Class
Returns:
boolean
Throws:
ClassNotFoundException

setInitialAndDefaultValue

public void setInitialAndDefaultValue(Object value_p)
Description copied from class: OwSearchCriteria
set the initial/default value for the search

Overrides:
setInitialAndDefaultValue in class OwSearchCriteria

setOperator

public void setOperator(int op_p)
Description copied from class: OwSearchCriteria
set the criteria operator which should be applied to the value as defined in OwSearchCriteria

Overrides:
setOperator in class OwSearchCriteria

setValue

public void setValue(Object value_p)
Description copied from class: OwSearchCriteria
set the compare value for the search

Specified by:
setValue in interface OwField
Overrides:
setValue in class OwSearchCriteria
Parameters:
value_p - value of field if field is scalar, or a java.io.List of objects if field is an array

setWildCardDefinitions

public void setWildCardDefinitions(Collection wildcarddefinitions_p)
Description copied from class: OwSearchCriteria
set the wildcard definitions for this criteria

Overrides:
setWildCardDefinitions in class OwSearchCriteria
Parameters:
wildcarddefinitions_p - Collection of OwWildCardDefinition, or null if no wildcards are allowed


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.