org.kuali.rice.krms.api.repository.proposition
Class PropositionDefinition

java.lang.Object
  extended by org.kuali.rice.krms.api.repository.proposition.PropositionDefinition
All Implemented Interfaces:
Serializable, Identifiable, Versioned, ModelObjectBasic, ModelObjectComplete, PropositionDefinitionContract

public final class PropositionDefinition
extends Object
implements PropositionDefinitionContract, ModelObjectComplete

Concrete model object implementation of KRMS Proposition. Immutable. Instances of Proposition can be (un)marshalled to and from XML. There are three main types of Propositions: 1. Compound Propositions - a proposition consisting of other propositions and a boolean algebra operator (AND, OR) defining how to evaluate those propositions. 2. Parameterized Propositions - a proposition which is parameterized by some set of values, evaluation logic is implemented by hand and returns true or false 3. Simple Propositions - a proposition of the form lhs op rhs where lhs=left-hand side, rhs=right-hand side, and op=operator Propositions are reference by a rule or another proposition (in the case of compound propositions). Propositions are never re-used across multiple rules. Each proposition can have zero or more parameters. The proposition parameter is the primary data element used to define the proposition. (@see PropositionParameter)

See Also:
PropositonContract, PropositionParameterContract, Serialized Form

Nested Class Summary
static class PropositionDefinition.Builder
          This builder is used to construct instances of KRMS Proposition.
(package private) static class PropositionDefinition.Constants
          Defines some internal constants used on this class.
static class PropositionDefinition.Elements
          A private class which exposes constants which define the XML element names to use when this object is marshalled to XML.
 
Field Summary
private  Collection<Element> _futureElements
           
private  List<PropositionDefinition> compoundComponents
           
private  String compoundOpCode
           
private  String description
           
private  String id
           
private  List<PropositionParameter> parameters
           
private  String propositionTypeCode
           
private  String ruleId
           
private static long serialVersionUID
           
private  String typeId
           
private  Long versionNumber
           
 
Constructor Summary
private PropositionDefinition()
          This constructor should never be called.
private PropositionDefinition(PropositionDefinition.Builder builder)
          Constructs a KRMS Proposition from the given builder.
 
Method Summary
 boolean equals(Object obj)
          All "Complete" model object's should adhere to the ModelObjectComplete.equals(Object) contract.
 List<PropositionDefinition> getCompoundComponents()
          This method returns the propositions which are contained in a compound proposition.
 String getCompoundOpCode()
          This method returns the op code to be used when evaluating compound propositions.
 String getDescription()
          This is the description text for the KRMS proposition
 String getId()
          The unique identifier for an object.
 List<PropositionParameter> getParameters()
          This is the parameter list of the proposition.
 String getPropositionTypeCode()
           There are three main types of Propositions: Compound Propositions - a proposition consisting of other propositions and a boolean algebra operator (AND, OR) defining how to evaluate those propositions.
 String getRuleId()
          This returns the ID of the rule this proposition belongs to.
 String getTypeId()
          This is the id of Proposition KrmsType of the proposition.
 Long getVersionNumber()
          Returns the version number for this object.
 int hashCode()
          All "Complete" model object's should adhere to the ModelObjectComplete.hashCode() contract.
 String toString()
          This will return a proper string representation of the Model Object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

id

private String id

description

private String description

typeId

private String typeId

ruleId

private String ruleId

propositionTypeCode

private String propositionTypeCode

parameters

private List<PropositionParameter> parameters

compoundOpCode

private String compoundOpCode

compoundComponents

private List<PropositionDefinition> compoundComponents

versionNumber

private final Long versionNumber

_futureElements

private final Collection<Element> _futureElements
Constructor Detail

PropositionDefinition

private PropositionDefinition()
This constructor should never be called. It is only present for use during JAXB unmarshalling.


PropositionDefinition

private PropositionDefinition(PropositionDefinition.Builder builder)
Constructs a KRMS Proposition from the given builder. This constructor is private and should only ever be invoked from the builder.

Parameters:
builder - the Builder from which to construct the KRMS Proposition
Method Detail

getId

public String getId()
Description copied from interface: Identifiable
The unique identifier for an object. This can be null.

Specified by:
getId in interface Identifiable
Returns:
the id

getDescription

public String getDescription()
Description copied from interface: PropositionDefinitionContract
This is the description text for the KRMS proposition

Specified by:
getDescription in interface PropositionDefinitionContract
Returns:
description for KRMS type.

getRuleId

public String getRuleId()
Description copied from interface: PropositionDefinitionContract
This returns the ID of the rule this proposition belongs to. May be null if this proposition has not yet been persisted.

Specified by:
getRuleId in interface PropositionDefinitionContract
Returns:
the ruleId

getTypeId

public String getTypeId()
Description copied from interface: PropositionDefinitionContract
This is the id of Proposition KrmsType of the proposition. It provides some context to what type of object of the KRMS type.

Specified by:
getTypeId in interface PropositionDefinitionContract
Returns:
the id of the KRMS type.

getPropositionTypeCode

public String getPropositionTypeCode()
Description copied from interface: PropositionDefinitionContract

There are three main types of Propositions: Compound Propositions - a proposition consisting of other propositions and a boolean algebra operator (AND, OR) defining how to evaluate those propositions. Parameterized Propositions - a proposition which is parameterized by some set of values, evaluation logic is implemented by hand and returns true or false Simple Propositions - a proposition of the form lhs op rhs where lhs=left-hand side, rhs=right-hand side, and op=operator

Specified by:
getPropositionTypeCode in interface PropositionDefinitionContract
Returns:
the proposition type code of the proposition

Valid values are C = compound, P = parameterized, S = simple


getParameters

public List<PropositionParameter> getParameters()
Description copied from interface: PropositionDefinitionContract
This is the parameter list of the proposition. Parameters are listed in Reverse Polish Notation. Parameters may be constants, terms, or functions.

Compound Propositions will have an empty parameter list.

Specified by:
getParameters in interface PropositionDefinitionContract
Returns:
the Parameters related to the proposition
See Also:
PropositionParameter

getCompoundOpCode

public String getCompoundOpCode()
Description copied from interface: PropositionDefinitionContract
This method returns the op code to be used when evaluating compound propositions.

Specified by:
getCompoundOpCode in interface PropositionDefinitionContract
Returns:
the compound op code. valid values are A = and, O = or

getCompoundComponents

public List<PropositionDefinition> getCompoundComponents()
Description copied from interface: PropositionDefinitionContract
This method returns the propositions which are contained in a compound proposition.

Specified by:
getCompoundComponents in interface PropositionDefinitionContract
Returns:
an ordered list of the Propositions which make up the compound proposition.

getVersionNumber

public Long getVersionNumber()
Description copied from interface: Versioned
Returns the version number for this object. In general, this value should only be null if the object has not yet been stored to a persistent data store. This version number is generally used for the purposes of optimistic locking.

Specified by:
getVersionNumber in interface Versioned
Returns:
the version number, or null if one has not been assigned yet

hashCode

public int hashCode()
Description copied from interface: ModelObjectComplete
All "Complete" model object's should adhere to the ModelObjectComplete.hashCode() contract.

Specified by:
hashCode in interface ModelObjectComplete
Overrides:
hashCode in class Object
Returns:
the hashCode value

equals

public boolean equals(Object obj)
Description copied from interface: ModelObjectComplete
All "Complete" model object's should adhere to the ModelObjectComplete.equals(Object) contract.

Specified by:
equals in interface ModelObjectComplete
Overrides:
equals in class Object
Parameters:
obj - to object to compare for equality
Returns:
if equal

toString

public String toString()
Description copied from interface: ModelObjectBasic
This will return a proper string representation of the Model Object. All of the fields comprising the "public" api should be represented in the return value.

Specified by:
toString in interface ModelObjectBasic
Overrides:
toString in class Object
Returns:
the string representation


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.