org.grinvin.invariants

Interface InvariantFactory

All Superinterfaces:
Factory, InvariantNode

public interface InvariantFactory
extends Factory, InvariantNode

An object that satisfies this interface can be used to create an invariant. To have a factory create an invariant, first set its parameters using InvariantFactory and then call createInvariant().

Method Summary

Invariant
createInvariant()
Creates and returns an invariant for the current parameter values.
Iterable
getChildren()
Always should return null.
String
getId()
Return the generic identifier of this factory.
String
getInvariantId()
Return the id of the invariant which will be created from this factory when using the current parameter values.
String
getName()
Return the localized name for this parametrized invariant.
String
toString()
Should return the same string as getName().

Methods inherited from interface org.grinvin.factories.Factory

getParameterValues, getParameters, setParameterValues

Methods inherited from interface org.grinvin.invariants.InvariantNode

accept, getChildren, getName

Method Details

createInvariant

public Invariant createInvariant()
            throws FactoryParameterException
Creates and returns an invariant for the current parameter values.
Throws:
FactoryParameterException - when the parameters were not set in an appropriate manner before this method was called.

getChildren

public Iterable getChildren()
Always should return null. A factory cannot have other invariant nodes as children.
Specified by:
getChildren in interface InvariantNode

getId

public String getId()
Return the generic identifier of this factory. Should be a prefix of every invariant id generated by this factory.

getInvariantId

public String getInvariantId()
            throws FactoryParameterException
Return the id of the invariant which will be created from this factory when using the current parameter values. Every id returned by this method has the same structure: it starts with the generic id, as returned by getId() and is followed by a parameter string, which is structured like a query string of a URI.

getName

public String getName()
Return the localized name for this parametrized invariant.
Specified by:
getName in interface InvariantNode

toString

public String toString()