java.lang.Object
org.refcodes.criteria.AbstractCriteria
org.refcodes.criteria.AbstractCriteriaNode
- All Implemented Interfaces:
Criteria,CriteriaNode,org.refcodes.mixin.AliasAccessor,org.refcodes.mixin.Schemable<CriteriaSchema>
- Direct Known Subclasses:
AndCriteria,IntersectWithCriteria,NotCriteria,OrCriteria
Base class with the base functionality provided for
CriteriaNode implementations.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.AliasAccessor
org.refcodes.mixin.AliasAccessor.AliasBuilder<B extends org.refcodes.mixin.AliasAccessor.AliasBuilder<B>>, org.refcodes.mixin.AliasAccessor.AliasMutator, org.refcodes.mixin.AliasAccessor.AliasProperty -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractCriteriaNode(String aAlias) Constructs aCriteriaNodewith the given name.AbstractCriteriaNode(String aAlias, List<Criteria> aChildren) Constructs aCriteriaNodewith the given name and the backing(!)AbstractCriteriaNode(String aAlias, Criteria... aChildren) Constructs aCriteriaNodewith the given name and the providedCriteriachildren. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a childCriteriato theCriteriaNode.Returns the list of childCriteriainstances contained in theCriteriaNode.Creates aCriteriaSchemafor aCriteriaNodesub-class with the instance's type and alias as well as the provided description.Methods inherited from class org.refcodes.criteria.AbstractCriteria
getAliasMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.refcodes.mixin.AliasAccessor
getAliasMethods inherited from interface org.refcodes.mixin.Schemable
toSchema
-
Field Details
-
_children
-
-
Constructor Details
-
AbstractCriteriaNode
Constructs aCriteriaNodewith the given name.- Parameters:
aAlias- The name of theCriteriaNode.
-
AbstractCriteriaNode
Constructs aCriteriaNodewith the given name and the providedCriteriachildren.- Parameters:
aAlias- The name of theCriteriaNode.aChildren- TheCriteriachildren to be contained in theCriteriaNode.
-
AbstractCriteriaNode
Constructs aCriteriaNodewith the given name and the backing(!)Listof theCriteriachildren to be provided: ThegetChildren()method will return the backingListas given, so you may provide an unmodifiableListif needed!- Parameters:
aAlias- The name of theCriteriaNode.aChildren- The backing(!)Listof theCriteriachildren to be used by theCriteriaNode.
-
-
Method Details
-
addChild
Adds a childCriteriato theCriteriaNode. In case a https://www.metacodes.proizedCriteriaNodeapplies constraints on the number or type ofCriteriawhich may be added, an according exception may be thrown. For example a singleCriteriaNodemay apply constraints on this method.- Specified by:
addChildin interfaceCriteriaNode- Parameters:
aChild- The childCriteriato be added.- Throws:
IllegalStateException- In case constraints in terms of state are violated, implementation depended.IllegalArgumentException- In case constraints in terms of argument are violated, implementation depended.
-
getChildren
Returns the list of childCriteriainstances contained in theCriteriaNode.- Specified by:
getChildrenin interfaceCriteriaNode- Returns:
- The
Criteriainstances contained in theCriteriaNode.
-
toSchema
Creates aCriteriaSchemafor aCriteriaNodesub-class with the instance's type and alias as well as the provided description.- Parameters:
aDescription- The description to use for theSchemainstance.- Returns:
- The according
Schemainstance.
-