org.nakedobjects.metamodel.facets.properties
Class PropertyMethodsFacetFactory

java.lang.Object
  extended by org.nakedobjects.metamodel.facets.FacetFactoryAbstract
      extended by org.nakedobjects.metamodel.java5.MethodPrefixBasedFacetFactoryAbstract
          extended by org.nakedobjects.metamodel.java5.PropertyOrCollectionIdentifyingFacetFactoryAbstract
              extended by org.nakedobjects.metamodel.facets.properties.PropertyMethodsFacetFactory
All Implemented Interfaces:
FacetFactory, PropertyOrCollectionIdentifyingFacetFactory, MethodPrefixBasedFacetFactory, RuntimeContextAware, CollectionTypeRegistryAware, SpecificationLoaderAware

public class PropertyMethodsFacetFactory
extends PropertyOrCollectionIdentifyingFacetFactoryAbstract
implements RuntimeContextAware


Field Summary
protected static java.lang.String CLEAR_PREFIX
           
protected static java.lang.String GET_PREFIX
           
protected static java.lang.String IS_PREFIX
           
protected static java.lang.String MODIFY_PREFIX
           
protected static java.lang.String SET_PREFIX
           
 
Fields inherited from class org.nakedobjects.metamodel.java5.MethodPrefixBasedFacetFactoryAbstract
CHOICES_PREFIX, CLASS, DEFAULT_PREFIX, NO_PARAMETERS, NO_PARAMETERS_TYPES, OBJECT, VALIDATE_PREFIX
 
Constructor Summary
PropertyMethodsFacetFactory()
           
 
Method Summary
 void findAndRemoveCollectionAccessors(MethodRemover methodRemover, java.util.List<java.lang.reflect.Method> methodListToAppendTo)
          Use the provided MethodRemover to remove all collection accessors, and append them to the supplied methodList.
 void findAndRemovePropertyAccessors(MethodRemover methodRemover, java.util.List<java.lang.reflect.Method> methodListToAppendTo)
          Use the provided MethodRemover to remove all reference property accessors, and append them to the supplied methodList.
 boolean isCollectionAccessor(java.lang.reflect.Method method)
          The method way well represent a collection, but this facet factory does not have any opinion on the matter.
 boolean isPropertyAccessor(java.lang.reflect.Method method)
          Whether (this facet is able to determine that) the supplied Method represents either a value property or a reference property.
 boolean isPropertyOrCollectionAccessorCandidate(java.lang.reflect.Method method)
          Whether (this facet is able to determine that) the supplied Method possibly represents the accessor of either a value property, reference property or a collection.
 boolean process(java.lang.reflect.Method getMethod, MethodRemover methodRemover, FacetHolder property)
          Process the method, and return the correctly setup annotation if present.
 void setRuntimeContext(RuntimeContext runtimeContext)
          Injected because RuntimeContextAware.
 
Methods inherited from class org.nakedobjects.metamodel.java5.PropertyOrCollectionIdentifyingFacetFactoryAbstract
getCollectionTypeRepository, isCollectionOrArray, setCollectionTypeRegistry
 
Methods inherited from class org.nakedobjects.metamodel.java5.MethodPrefixBasedFacetFactoryAbstract
findAndRemoveAlwaysHideMethod, findAndRemoveAlwaysHideMethod, findAndRemoveAlwaysHideMethod, findAndRemoveDescriptionMethod, findAndRemoveDescriptionMethod, findAndRemoveDescriptionMethod, findAndRemoveDisableForSessionMethod, findAndRemoveDisableForSessionMethod, findAndRemoveDisableMethod, findAndRemoveDisableMethod, findAndRemoveDisableMethod, findAndRemoveHideForSessionMethod, findAndRemoveHideForSessionMethod, findAndRemoveHideMethod, findAndRemoveHideMethod, findAndRemoveHideMethod, findAndRemoveNameMethod, findAndRemoveNameMethod, findAndRemoveNameMethod, findAndRemoveProtectMethod, findAndRemoveProtectMethod, findAndRemoveProtectMethod, findMethod, findMethod, findMethodWithOrWithoutParameters, getPrefixes, paramTypesOrNull, removeMethod
 
Methods inherited from class org.nakedobjects.metamodel.facets.FacetFactoryAbstract
getFeatureTypes, getSpecificationLoader, process, processParams, setSpecificationLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nakedobjects.metamodel.facets.FacetFactory
getFeatureTypes, process, processParams
 

Field Detail

CLEAR_PREFIX

protected static final java.lang.String CLEAR_PREFIX
See Also:
Constant Field Values

GET_PREFIX

protected static final java.lang.String GET_PREFIX
See Also:
Constant Field Values

IS_PREFIX

protected static final java.lang.String IS_PREFIX
See Also:
Constant Field Values

MODIFY_PREFIX

protected static final java.lang.String MODIFY_PREFIX
See Also:
Constant Field Values

SET_PREFIX

protected static final java.lang.String SET_PREFIX
See Also:
Constant Field Values
Constructor Detail

PropertyMethodsFacetFactory

public PropertyMethodsFacetFactory()
Method Detail

process

public boolean process(java.lang.reflect.Method getMethod,
                       MethodRemover methodRemover,
                       FacetHolder property)
Description copied from interface: FacetFactory
Process the method, and return the correctly setup annotation if present.

Specified by:
process in interface FacetFactory
Overrides:
process in class FacetFactoryAbstract
Parameters:
getMethod - - method representing the feature being processed (getter for property or collection, or action)
methodRemover - - allow any methods of the class to be removed
property - - to attach the facets to
Returns:
true if any facets were added and therefore should be removed, false otherwise. Returning true will cause the method to be removed

isPropertyOrCollectionAccessorCandidate

public boolean isPropertyOrCollectionAccessorCandidate(java.lang.reflect.Method method)
Description copied from interface: PropertyOrCollectionIdentifyingFacetFactory
Whether (this facet is able to determine that) the supplied Method possibly represents the accessor of either a value property, reference property or a collection.

For example, if a method name has a prefix of get or alternatively has a prefix of is and returns a boolean, then it would be a candidate.

Specified by:
isPropertyOrCollectionAccessorCandidate in interface PropertyOrCollectionIdentifyingFacetFactory

isCollectionAccessor

public boolean isCollectionAccessor(java.lang.reflect.Method method)
The method way well represent a collection, but this facet factory does not have any opinion on the matter.

Specified by:
isCollectionAccessor in interface PropertyOrCollectionIdentifyingFacetFactory

isPropertyAccessor

public boolean isPropertyAccessor(java.lang.reflect.Method method)
Description copied from interface: PropertyOrCollectionIdentifyingFacetFactory
Whether (this facet is able to determine that) the supplied Method represents either a value property or a reference property.

Specified by:
isPropertyAccessor in interface PropertyOrCollectionIdentifyingFacetFactory

findAndRemovePropertyAccessors

public void findAndRemovePropertyAccessors(MethodRemover methodRemover,
                                           java.util.List<java.lang.reflect.Method> methodListToAppendTo)
Description copied from interface: PropertyOrCollectionIdentifyingFacetFactory
Use the provided MethodRemover to remove all reference property accessors, and append them to the supplied methodList.

Specified by:
findAndRemovePropertyAccessors in interface PropertyOrCollectionIdentifyingFacetFactory

findAndRemoveCollectionAccessors

public void findAndRemoveCollectionAccessors(MethodRemover methodRemover,
                                             java.util.List<java.lang.reflect.Method> methodListToAppendTo)
Description copied from interface: PropertyOrCollectionIdentifyingFacetFactory
Use the provided MethodRemover to remove all collection accessors, and append them to the supplied methodList.

Specified by:
findAndRemoveCollectionAccessors in interface PropertyOrCollectionIdentifyingFacetFactory

setRuntimeContext

public void setRuntimeContext(RuntimeContext runtimeContext)
Injected because RuntimeContextAware.

Specified by:
setRuntimeContext in interface RuntimeContextAware


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.