net.sourceforge.domian.specification
Class ParameterizedSpecification<T,F>

java.lang.Object
  extended by net.sourceforge.domian.specification.AbstractSpecification<T>
      extended by net.sourceforge.domian.specification.ParameterizedSpecification<T,F>
All Implemented Interfaces:
LeafSpecification<T>, Specification<T>
Direct Known Subclasses:
FieldParameterizedSpecification, MethodParameterizedSpecification

abstract class ParameterizedSpecification<T,F>
extends AbstractSpecification<T>
implements LeafSpecification<T>

A parameterized specification deals, as opposed to value bound specifications, also with value context. In this specification, that context is a class method, or a class field.

Since:
0.1
Author:
Eirik Torske

Field Summary
protected  java.lang.reflect.AccessibleObject accessibleObject
           
protected  Specification<F> accessibleObjectSpecification
           
protected static Specification<ParameterizedSpecification> parameterizedSpecificationWithConjunctionSpec
           
protected static Specification<ParameterizedSpecification> parameterizedSpecificationWithDisjunctionSpec
           
 
Fields inherited from class net.sourceforge.domian.specification.AbstractSpecification
type
 
Constructor Summary
ParameterizedSpecification()
           
 
Method Summary
(package private) static
<T,F> ParameterizedSpecification<T,F>
createParameterizedSpecification(java.lang.Class<T> declaringClass, java.lang.String accessibleObjectName, Specification<F> accessibleObjectSpecification)
          Rather ugly factory method for creating parameterized specifications...
 boolean equals(java.lang.Object otherObject)
           
 java.lang.reflect.AccessibleObject getAccessibleObject()
           
 Specification<F> getAccessibleObjectSpecification()
           
 java.lang.Class<F> getAccessibleObjectSpecificationType()
           
protected  void getAllSpecifications(java.util.Set<Specification<?>> specificationSet)
          Populates the given set of specifications with all Specification objects in this object graph.
 java.lang.Class<T> getDeclaringClass()
           
(package private) abstract  java.lang.String getName()
           
protected  java.lang.Boolean hasConjunction()
           
protected  java.lang.Boolean hasDisjunction()
           
 int hashCode()
           
 java.lang.Boolean isDisjointWith(Specification<?> specification)
           
protected static boolean isValidFieldName(java.lang.String fieldName)
           
 
Methods inherited from class net.sourceforge.domian.specification.AbstractSpecification
and, containsSimpleCompositesOnly, containsValueBoundSpecificationsOnly, createValueBoundSpecification, getNegatedSpecification, getNumberOfLevelsOfNegations, getType, intersectsWith, invert, isGeneralizationOf, isIntersectionOf, isInvertible, isOddNumber, isSpecialCaseOf, or, purify, toString, where
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sourceforge.domian.specification.Specification
and, getType, isGeneralizationOf, isSatisfiedBy, isSpecialCaseOf, or, where
 

Field Detail

parameterizedSpecificationWithConjunctionSpec

protected static final Specification<ParameterizedSpecification> parameterizedSpecificationWithConjunctionSpec

parameterizedSpecificationWithDisjunctionSpec

protected static final Specification<ParameterizedSpecification> parameterizedSpecificationWithDisjunctionSpec

accessibleObject

protected java.lang.reflect.AccessibleObject accessibleObject

accessibleObjectSpecification

protected Specification<F> accessibleObjectSpecification
Constructor Detail

ParameterizedSpecification

ParameterizedSpecification()
Method Detail

createParameterizedSpecification

static <T,F> ParameterizedSpecification<T,F> createParameterizedSpecification(java.lang.Class<T> declaringClass,
                                                                              java.lang.String accessibleObjectName,
                                                                              Specification<F> accessibleObjectSpecification)
Rather ugly factory method for creating parameterized specifications...

Throws:
java.lang.SecurityException - if a security manager exists and if the caller does not have granted java.lang.reflect.ReflectPermission.suppressAccessChecks

isValidFieldName

protected static boolean isValidFieldName(java.lang.String fieldName)
Returns:
true if the field name does not start with '.',or a number

getDeclaringClass

public java.lang.Class<T> getDeclaringClass()

getAccessibleObject

public java.lang.reflect.AccessibleObject getAccessibleObject()

getAccessibleObjectSpecification

public Specification<F> getAccessibleObjectSpecification()

getAccessibleObjectSpecificationType

public java.lang.Class<F> getAccessibleObjectSpecificationType()

getName

abstract java.lang.String getName()

hasConjunction

protected java.lang.Boolean hasConjunction()
Overrides:
hasConjunction in class AbstractSpecification<T>
Returns:
true if at least one of this specification's composites is a conjunction

hasDisjunction

protected java.lang.Boolean hasDisjunction()
Overrides:
hasDisjunction in class AbstractSpecification<T>
Returns:
true if at least one of this specification's composites is a disjunction

getAllSpecifications

protected final void getAllSpecifications(java.util.Set<Specification<?>> specificationSet)
Description copied from class: AbstractSpecification
Populates the given set of specifications with all Specification objects in this object graph. In other words, the Set is a flattened, unordered version of the Specification object graph.

Overrides:
getAllSpecifications in class AbstractSpecification<T>
Parameters:
specificationSet - Set of specifications

isDisjointWith

public java.lang.Boolean isDisjointWith(Specification<?> specification)
Specified by:
isDisjointWith in interface Specification<T>
Overrides:
isDisjointWith in class AbstractSpecification<T>

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object otherObject)
Overrides:
equals in class java.lang.Object


Copyright © 2006-2010. All Rights Reserved.