The following features are supported:
Rules can have wildcards.
Rules are ordered according to their precedence. @author Mika Riekkinen @author Joni Suominen @version $Revision: 1.16 $ $Date: 2004/03/02 07:37:11 $
A testable rule to which HL7 messages (at least certain specific message) should conform. This is the central interface of the new HAPI validation model (as of HAPI 0.4). Previously, the only run-time message validation HAPI performs is within the setValue() methods of the Primitive datatype classes. For example when you called setValue() on a DT an exception was thrown if the String arg was not in the correct DT format. This method served well initially but left us with the following limitations:
Thus the new validation model is broader in scope, and is based on validation rules implemented as Rule objects, which can be configured to run or not, as needed, depending on run-time configuration.
There are three kinds of rules:
A {@link Rule} can be compared to a CSS media query and it's content. In CSS media queries you define a condition anda block that will be active when this query becomes active. With a {@link Rule} it's the same. You define{@link Condition}s and instead of a block you will define {@link Instruction}s.
A {@link Rule} is used everywhere in Passe-Partout. You work with them when using {@link FluidGridLayout}, {@link QueryListener} or responsive {@link Resource}s.
@see Condition @see Instruction @noimplement This interface is not intended to be implemented by clients. @since 0.9The following features are supported:
This represents the rule specification but most engines will compile this specification into an abstract machine or processing graph.
The rule specification comprises a list of antecendents (body) and a list of consequents (head). If there is more than one consequent then a backchainer should regard this as a shorthand for several rules, all with the same body but with a singleton head.
Each element in the head or body can be a TriplePattern, a Functor or a Rule. A TriplePattern is just a triple of Nodes but the Nodes can represent variables, wildcards and embedded functors - as well as constant uri or literal graph nodes. A functor comprises a functor name and a list of arguments. The arguments are Nodes of any type except functor nodes (there is no functor nesting). The functor name can be mapped into a registered java class that implements its semantics. Functors play three roles - in heads they represent actions (procedural attachement); in bodies they represent builtin predicates; in TriplePatterns they represent embedded structured literals that are used to cache matched subgraphs such as restriction specifications.
The equality contract for rules is that two rules are equal if each of terms (ClauseEntry objects) are equals and they have the same name, if any.
We include a trivial, recursive descent parser but this is just there to allow rules to be embedded in code. External rule syntax based on N3 and RDF could be developed. The embedded syntax supports rules such as:[ (?C rdf:type *), guard(?C, ?P) -> (?c rb:restriction some(?P, ?D)) ].
[ (?s owl:foo ?p) -> [ (?s owl:bar ?a) -> (?s ?p ?a) ] ].
[name: (?s owl:foo ?p) -> (?s ?p ?a)].
Expression expr = ...; Rule = new ...; if (expr.isApplicable(rule)) expr = rule.apply();
@author Elemér Furka
Writing a custom Rule is considered perfectly normal when using Digester, and is encouraged whenever the default set of Rule classes don't meet your requirements; the digester framework can help process xml even when the built-in rules aren't quite what is needed. Creating a custom Rule is just as easy as subclassing javax.servlet.http.HttpServlet for webapps, or javax.swing.Action for GUI applications.
If a rule wishes to manipulate a digester stack (the default object stack, a named stack, or the parameter stack) then it should only ever push objects in the rule's begin method and always pop exactly the same number of objects off the stack during the rule's end method. Of course peeking at the objects on the stacks can be done from anywhere.
Rule objects should be stateless, ie they should not update any instance member during the parsing process. A rule instance that changes state will encounter problems if invoked in a "nested" manner; this can happen if the same instance is added to digester multiple times or if a wildcard pattern is used which can match both an element and a child of the same element. The digester object stack and named stacks should be used to store any state that a rule requires, making the rule class safe under all possible uses.
Writing a custom Rule is considered perfectly normal when using Digester, and is encouraged whenever the default set of Rule classes don't meet your requirements; the digester framework can help process xml even when the built-in rules aren't quite what is needed. Creating a custom Rule is just as easy as subclassing javax.servlet.http.HttpServlet for webapps, or javax.swing.Action for GUI applications.
If a rule wishes to manipulate a digester stack (the default object stack, a named stack, or the parameter stack) then it should only ever push objects in the rule's begin method and always pop exactly the same number of objects off the stack during the rule's end method. Of course peeking at the objects on the stacks can be done from anywhere.
Rule objects should be stateless, ie they should not update any instance member during the parsing process. A rule instance that changes state will encounter problems if invoked in a "nested" manner; this can happen if the same instance is added to digester multiple times or if a wildcard pattern is used which can match both an element and a child of the same element. The digester object stack and named stacks should be used to store any state that a rule requires, making the rule class safe under all possible uses.
Rule
matches against DOM4J Node so that some action can be performed such as in the XSLT processing model.
Rule
contains a set of Test
s and a Consequence
. The Test
s describe the circumstances that representrepresent a match for this rule. The Consequence
gets fired when the Conditions match.
Rule
contains a set of Condition
s and a Consequence
. The Condition
s describe the circumstances that representrepresent a match for this rule. The Consequence
gets fired when the Conditions match.
@see Condition
@see Consequence
@author bob mcwhirter
@author Simon Harris
@author mark pro
<xsd:element name="Rule"> <xsd:annotation> <xsd:documentation> A Rule is used to attach property/scale conditions to and group the individual symbolizers used for rendering. </xsd:documentation> </xsd:annotation> <xsd:complexType> <xsd:sequence> <xsd:element ref="sld:Name" minOccurs="0"/> <xsd:element ref="sld:Title" minOccurs="0"/> <xsd:element ref="sld:Abstract" minOccurs="0"/> <xsd:element ref="sld:LegendGraphic" minOccurs="0"/> <xsd:choice minOccurs="0"> <xsd:element ref="ogc:Filter"/> <xsd:element ref="sld:ElseFilter"/> </xsd:choice> <xsd:element ref="sld:MinScaleDenominator" minOccurs="0"/> <xsd:element ref="sld:MaxScaleDenominator" minOccurs="0"/> <xsd:element ref="sld:Symbolizer" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element>
@source $URL$
A {@code Rule} represents some action to perform when an unknown domain object is referenced. The rule can use thedomain object name to add an implicit domain object.
All rules used by Roolie must implement this interface.
In general, a Rule will be responsible for evaluating a "bite-sized" aspect of an application (i.e. Is a number in a given range? Is a user logged in?). These rules can be chained together with other rules to build more complex rules using the configuration file, although they may be used individually as well.
Rule implementation class requirements:
java.lang.String
or java.util.List<String>
(Of course you may parse them to whatever data type you wish when you use those values). The following features are supported:
The following features are supported:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|