to.etc.domui.component.meta.impl
Class ClassMetaModelWrapper

java.lang.Object
  extended by to.etc.domui.component.meta.impl.ClassMetaModelWrapper
All Implemented Interfaces:
ClassMetaModel

public class ClassMetaModelWrapper
extends java.lang.Object
implements ClassMetaModel

This class can be used as a "proxy class" or "delegate class" to another ClassMetaModel instance. You can then override the methods you need changed only while all others are delegated to the original metamodel.

Author:
Frits Jalvingh Created on Dec 28, 2010

Constructor Summary
protected ClassMetaModelWrapper(ClassMetaModel parent)
           
 
Method Summary
 QCriteria<?> createCriteria()
          EXPERIMENTAL If this is a persistent class, this should create a base QCriteria instance to do queries on this class.
 PropertyMetaModel<?> findProperty(java.lang.String name)
          Returns a property reference to the specified property by following the dotted path starting at this class.
 PropertyMetaModel<?> findSimpleProperty(java.lang.String name)
          Returns the named property on this class.
 java.lang.Class<?> getActualClass()
          FIXME Questionable nullity
 BundleRef getClassBundle()
          Returns the message bundle for translations related to this class.
 java.lang.Class<? extends IComboDataSet<?>> getComboDataSet()
          If this class is the UP in a relation this specifies that it must be shown as a COMBOBOX containing choices.
 java.util.List<DisplayPropertyMetaModel> getComboDisplayProperties()
          If this object is shown in a combobox it needs to show the following properties as the display value.
 java.lang.Class<? extends ILabelStringRenderer<?>> getComboLabelRenderer()
          When this relation-property is presented as a single field this can contain a class to render that field as a string.
 java.lang.Class<? extends INodeContentRenderer<?>> getComboNodeRenderer()
          When set, the entire content of a combobox's OPTION tag can be generated by this content renderer.
 java.lang.String getComponentTypeHint()
          When present this gives a hint to the component factories to help with choosing a proper component to select a single record of this type.
 SortableType getDefaultSortDirection()
          When a ClassMetaModel.getDefaultSortProperty() is defined, this defines the sort order to use initially.
 java.lang.String getDefaultSortProperty()
          Contains the name of the property to use for sorting initially.
 java.lang.String getDomainLabel(java.util.Locale loc, java.lang.Object value)
          For a Domain type (Enum, Boolean) this returns a label for a given domain value, or null if no label is defined.
 java.lang.Object[] getDomainValues()
          If this class is an Enum or represents some enumerated value, this returns the possible value objects.
 java.util.List<SearchPropertyMetaModel> getKeyWordSearchProperties()
          Returns the SORTED list of key word search properties defined on this class.
 java.util.List<DisplayPropertyMetaModel> getLookupSelectedProperties()
          When this class is to be selected as a parent in an UP relation using an InputLookup control this describes the properties to use to display the currently selected record in the edit page.
 java.lang.Class<? extends INodeContentRenderer<?>> getLookupSelectedRenderer()
          When this class is to be selected as a parent in an UP relation using an InputLookup control this describes the renderer to use to display the currently selected record in the edit page.
 PropertyMetaModel<?> getPrimaryKey()
          Returns the property containing the primary key for this object, if one can be found.
 java.util.List<PropertyMetaModel<?>> getProperties()
           
 java.util.List<SearchPropertyMetaModel> getSearchProperties()
          Returns the SORTED list of search properties defined on this class.
 java.util.List<DisplayPropertyMetaModel> getTableDisplayProperties()
          If this object is shown in a Table it needs to show the following properties there.
 java.lang.String getTableName()
          If this is a persistent class that is directly mapped onto some table, this might return the table name.
 java.lang.String getUserEntityName()
          Return a user-presentable entity name (singular) for this class.
 java.lang.String getUserEntityNamePlural()
          Returns the name of this entity in user terms; the returned name is plural.
 ClassMetaModel getWrappedModel()
           
 boolean isPersistentClass()
           
 void setWrappedModel(ClassMetaModel parent)
          WATCH OUT: Should only be used when initializing outside the constructor; should not change after this has been passed to user code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassMetaModelWrapper

protected ClassMetaModelWrapper(ClassMetaModel parent)
Method Detail

getWrappedModel

public ClassMetaModel getWrappedModel()

setWrappedModel

public void setWrappedModel(ClassMetaModel parent)
WATCH OUT: Should only be used when initializing outside the constructor; should not change after this has been passed to user code.

Parameters:
parent -

findProperty

public PropertyMetaModel<?> findProperty(java.lang.String name)
Description copied from interface: ClassMetaModel
Returns a property reference to the specified property by following the dotted path starting at this class. This returns a synthetic PropertyMetaModel which has all of the values for the last part in the path (the actual property reached), but with accessors that reach that property by following all intermediary objects.

Specified by:
findProperty in interface ClassMetaModel
Returns:

findSimpleProperty

public PropertyMetaModel<?> findSimpleProperty(java.lang.String name)
Description copied from interface: ClassMetaModel
Returns the named property on this class. This does not allow a property path (dotted names).

Specified by:
findSimpleProperty in interface ClassMetaModel
Returns:

getActualClass

public java.lang.Class<?> getActualClass()
Description copied from interface: ClassMetaModel
FIXME Questionable nullity

Specified by:
getActualClass in interface ClassMetaModel
Returns:

getClassBundle

public BundleRef getClassBundle()
Description copied from interface: ClassMetaModel
Returns the message bundle for translations related to this class. This will never return null.

Specified by:
getClassBundle in interface ClassMetaModel
Returns:

getComboDataSet

public java.lang.Class<? extends IComboDataSet<?>> getComboDataSet()
Description copied from interface: ClassMetaModel
If this class is the UP in a relation this specifies that it must be shown as a COMBOBOX containing choices. It contains a generator for the values to show. This is a default for all relations in which this class is the parent; it can be overridden in individual relations.

Specified by:
getComboDataSet in interface ClassMetaModel
Returns:

getComboDisplayProperties

public java.util.List<DisplayPropertyMetaModel> getComboDisplayProperties()
Description copied from interface: ClassMetaModel
If this object is shown in a combobox it needs to show the following properties as the display value.

Specified by:
getComboDisplayProperties in interface ClassMetaModel
Returns:

getComboLabelRenderer

public java.lang.Class<? extends ILabelStringRenderer<?>> getComboLabelRenderer()
Description copied from interface: ClassMetaModel
When this relation-property is presented as a single field this can contain a class to render that field as a string.

Specified by:
getComboLabelRenderer in interface ClassMetaModel
Returns:

getComboNodeRenderer

public java.lang.Class<? extends INodeContentRenderer<?>> getComboNodeRenderer()
Description copied from interface: ClassMetaModel
When set, the entire content of a combobox's OPTION tag can be generated by this content renderer. When set, the ClassMetaModel.getComboDisplayProperties(), ClassMetaModel.getComboLabelRenderer() properties are ignored.

Specified by:
getComboNodeRenderer in interface ClassMetaModel
Returns:

getComponentTypeHint

public java.lang.String getComponentTypeHint()
Description copied from interface: ClassMetaModel
When present this gives a hint to the component factories to help with choosing a proper component to select a single record of this type. This is only used when this class is the parent in an UP relation, and the child needs to add a control to help it select one parent.

Specified by:
getComponentTypeHint in interface ClassMetaModel
Returns:

getDefaultSortDirection

public SortableType getDefaultSortDirection()
Description copied from interface: ClassMetaModel
When a ClassMetaModel.getDefaultSortProperty() is defined, this defines the sort order to use initially.

Specified by:
getDefaultSortDirection in interface ClassMetaModel
Returns:

getDefaultSortProperty

public java.lang.String getDefaultSortProperty()
Description copied from interface: ClassMetaModel
Contains the name of the property to use for sorting initially. It is used to define the initial sort order when a table is shown for the 1st time. It can be null in which case the table query defines the sort order.

Specified by:
getDefaultSortProperty in interface ClassMetaModel
Returns:

getDomainLabel

public java.lang.String getDomainLabel(java.util.Locale loc,
                                       java.lang.Object value)
Description copied from interface: ClassMetaModel
For a Domain type (Enum, Boolean) this returns a label for a given domain value, or null if no label is defined. When called for a non-domain type this will throw an exception.

Specified by:
getDomainLabel in interface ClassMetaModel
Returns:

getDomainValues

public java.lang.Object[] getDomainValues()
Description copied from interface: ClassMetaModel
If this class is an Enum or represents some enumerated value, this returns the possible value objects. If this is not a domain type this MUST return null.

Specified by:
getDomainValues in interface ClassMetaModel
Returns:

getKeyWordSearchProperties

public java.util.List<SearchPropertyMetaModel> getKeyWordSearchProperties()
Description copied from interface: ClassMetaModel
Returns the SORTED list of key word search properties defined on this class. These are used by LookupInput to define the "search-as-I-type" functionality. The value gets set from either the MetaSearch or the MetaSearch annotations.

Specified by:
getKeyWordSearchProperties in interface ClassMetaModel
Returns:

getLookupSelectedProperties

public java.util.List<DisplayPropertyMetaModel> getLookupSelectedProperties()
Description copied from interface: ClassMetaModel
When this class is to be selected as a parent in an UP relation using an InputLookup control this describes the properties to use to display the currently selected record in the edit page.

Specified by:
getLookupSelectedProperties in interface ClassMetaModel
Returns:

getLookupSelectedRenderer

public java.lang.Class<? extends INodeContentRenderer<?>> getLookupSelectedRenderer()
Description copied from interface: ClassMetaModel
When this class is to be selected as a parent in an UP relation using an InputLookup control this describes the renderer to use to display the currently selected record in the edit page. If null this will use ClassMetaModel.getLookupSelectedProperties().

Specified by:
getLookupSelectedRenderer in interface ClassMetaModel
Returns:

getPrimaryKey

public PropertyMetaModel<?> getPrimaryKey()
Description copied from interface: ClassMetaModel
Returns the property containing the primary key for this object, if one can be found.

Specified by:
getPrimaryKey in interface ClassMetaModel
Returns:

getProperties

public java.util.List<PropertyMetaModel<?>> getProperties()
Specified by:
getProperties in interface ClassMetaModel

getSearchProperties

public java.util.List<SearchPropertyMetaModel> getSearchProperties()
Description copied from interface: ClassMetaModel
Returns the SORTED list of search properties defined on this class. These are used by default for all table based search operations like LookupInput and LookupForm. The value gets set from either the MetaSearch or the MetaSearch annotations.

Specified by:
getSearchProperties in interface ClassMetaModel
Returns:

getTableDisplayProperties

public java.util.List<DisplayPropertyMetaModel> getTableDisplayProperties()
Description copied from interface: ClassMetaModel
If this object is shown in a Table it needs to show the following properties there. This value gets set from @MetaObject. These columns are also used when the table is shown as the result of a LookupInput search.

Specified by:
getTableDisplayProperties in interface ClassMetaModel
Returns:

getTableName

public java.lang.String getTableName()
Description copied from interface: ClassMetaModel
If this is a persistent class that is directly mapped onto some table, this might return the table name. This should NOT return a name for data that is strictly derived from a metamodel-based database because there all value records share the same table.

Specified by:
getTableName in interface ClassMetaModel
Returns:

getUserEntityName

public java.lang.String getUserEntityName()
Description copied from interface: ClassMetaModel
Return a user-presentable entity name (singular) for this class. This defaults to the classname itself if unset.

Specified by:
getUserEntityName in interface ClassMetaModel

getUserEntityNamePlural

public java.lang.String getUserEntityNamePlural()
Description copied from interface: ClassMetaModel
Returns the name of this entity in user terms; the returned name is plural.

Specified by:
getUserEntityNamePlural in interface ClassMetaModel
Returns:

isPersistentClass

public boolean isPersistentClass()
Specified by:
isPersistentClass in interface ClassMetaModel

createCriteria

public QCriteria<?> createCriteria()
                            throws java.lang.Exception
Description copied from interface: ClassMetaModel
EXPERIMENTAL If this is a persistent class, this should create a base QCriteria instance to do queries on this class. The QCriteria<T> instance returned must have a T that is equal to the value returned by this.getActualClass(). In addition it should have only restrictions that limit the result to valid instances of this class, nothing else! This usually means the restriction set is empty.

Needs evaluation.

Specified by:
createCriteria in interface ClassMetaModel
Returns:
Throws:
java.lang.Exception