org.nakedobjects.metamodel.facets.collections
Class CollectionFieldMethodsFacetFactory

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.collections.CollectionFieldMethodsFacetFactory
All Implemented Interfaces:
FacetFactory, PropertyOrCollectionIdentifyingFacetFactory, MethodPrefixBasedFacetFactory, RuntimeContextAware, CollectionTypeRegistryAware, SpecificationLoaderAware

public class CollectionFieldMethodsFacetFactory
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 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
CollectionFieldMethodsFacetFactory()
           
 
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)
          Whether (this facet is able to determine that) the supplied Method represents a collection.
 boolean isPropertyAccessor(java.lang.reflect.Method method)
          The method way well represent a reference property, but this facet factory does not have any opinion on the matter.
 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 isValuePropertyAccessor(java.lang.reflect.Method method)
          The method way well represent a value property, but this facet factory does not have any opinion on the matter.
 boolean process(java.lang.reflect.Method collectionAccessor, MethodRemover methodRemover, FacetHolder collection)
          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

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

CollectionFieldMethodsFacetFactory

public CollectionFieldMethodsFacetFactory()
Method Detail

process

public boolean process(java.lang.reflect.Method collectionAccessor,
                       MethodRemover methodRemover,
                       FacetHolder collection)
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:
collectionAccessor - - method representing the feature being processed (getter for property or collection, or action)
methodRemover - - allow any methods of the class to be removed
collection - - 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)
Description copied from interface: PropertyOrCollectionIdentifyingFacetFactory
Whether (this facet is able to determine that) the supplied Method represents a collection.

Specified by:
isCollectionAccessor in interface PropertyOrCollectionIdentifyingFacetFactory

isPropertyAccessor

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

Specified by:
isPropertyAccessor in interface PropertyOrCollectionIdentifyingFacetFactory

isValuePropertyAccessor

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


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

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

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.