com.gentics.api.lib.rule
Interface RuleTree

All Superinterfaces:
java.lang.Cloneable

Deprecated. the old RuleTrees are deprecated, use Expression instead.

public interface RuleTree
extends java.lang.Cloneable

RuleTree is the interface for parsed rules. Parsed rule trees can be passed to datasources as filters for fetching objects or can be used in rules.


Method Summary
 void addResolver(java.lang.String objectPrefix, java.util.Map resolvableMap)
          Deprecated. Add resolvable properties as map to the map of resolvers.
 void addResolver(java.lang.String objectPrefix, PropertyResolver resolver)
          Deprecated. Add a property resolver to the map of resolvers.
 void addResolver(java.lang.String objectPrefix, Resolvable resolvable)
          Deprecated. Add a property resolver to the map of resolvers.
 java.lang.Object clone()
          Deprecated. Clone the ruletree
 void concat(RuleTree ruletree, LogicalOperator operator)
          Deprecated. adds the given ruletree to the current ruletree, linking it with the given operator.
 RuleTree deepCopy()
          Deprecated. Creates a deep copy of the rule tree and all operands,operators,functions & co
 Expression getExpression()
          Deprecated. Get the parsed expression of this ruletree.
 java.lang.String getRuleString()
          Deprecated. get the parsed string of the rule (given via parse(String)).
 boolean hasChanged(long timestamp)
          Deprecated. Check whether the properties evaluated in this ruletree have changed since the given timestamp
 java.util.Iterator iterator()
          Deprecated. this method will not be implemented in future implementations and should not be used
 void parse(java.lang.String ruleString)
          Deprecated. Parse the given string into a ruletree.
 void removeResolver(java.lang.String objectPrefix)
          Deprecated. Remove a property resolver from the map of resolvers
 java.lang.Object resolve(java.lang.String objectPrefix, java.lang.String attribute)
          Deprecated. Resolve the given attribute for a resolver with the given objectPrefix
 int size()
          Deprecated. this method will not be implemented in future implementations and should not be used
 

Method Detail

iterator

java.util.Iterator iterator()
Deprecated. this method will not be implemented in future implementations and should not be used

get an iterator for all elements top level elements of the ruletree

Returns:
iterator

size

int size()
Deprecated. this method will not be implemented in future implementations and should not be used

get the number of top level elements in the ruletree

Returns:
number of elements

parse

void parse(java.lang.String ruleString)
           throws ParserException
Deprecated. 
Parse the given string into a ruletree. take care to reuse parsed ruletrees wherever possible by exchanging the resolver. Parsing Strings to RuleTrees is cost expensive.

Parameters:
ruleString - rule given as string
Throws:
ParserException - when the given string is not a valid rule

getRuleString

java.lang.String getRuleString()
Deprecated. 
get the parsed string of the rule (given via parse(String)).

Returns:
the rule as string

addResolver

void addResolver(java.lang.String objectPrefix,
                 PropertyResolver resolver)
Deprecated. 
Add a property resolver to the map of resolvers. When a resolver is added for a specific prefix, the rule may contain parts like [prefix].[property] which will be resolved with the given resolver.

Parameters:
objectPrefix - object prefix
resolver - property resolver

addResolver

void addResolver(java.lang.String objectPrefix,
                 Resolvable resolvable)
Deprecated. 
Add a property resolver to the map of resolvers. When a resolver is added for a specific prefix, the rule may contain parts like [prefix].[property] which will be resolved with the given resolver.

Parameters:
objectPrefix - object prefix
resolvable - resolvable object

addResolver

void addResolver(java.lang.String objectPrefix,
                 java.util.Map resolvableMap)
Deprecated. 
Add resolvable properties as map to the map of resolvers. When a resolver is added for a specific prefix, the rule may contain parts like [prefix].[property] which will be resolved with the given resolver.

Parameters:
objectPrefix - object prefix
resolvableMap - object properties as map

removeResolver

void removeResolver(java.lang.String objectPrefix)
Deprecated. 
Remove a property resolver from the map of resolvers

Parameters:
objectPrefix - object prefix

resolve

java.lang.Object resolve(java.lang.String objectPrefix,
                         java.lang.String attribute)
                         throws UnknownPropertyException
Deprecated. 
Resolve the given attribute for a resolver with the given objectPrefix

Parameters:
objectPrefix - object prefix
attribute - name of the attribute to resolve
Returns:
value of the attribute
Throws:
UnknownPropertyException - when the property is not known

concat

void concat(RuleTree ruletree,
            LogicalOperator operator)
Deprecated. 
adds the given ruletree to the current ruletree, linking it with the given operator. the given ruletree remains unchanged. example (descriptive syntax): tree1 = "water == cold" tree2 = "fire == hot"; tree1.concat(tree2, " && "); tree1 == "water == cold && fire == hot" tree2 == "fire == hot";

Parameters:
ruletree - the ruletree to add to the current object.
operator - the operator to link current object and given ruletree.

clone

java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Deprecated. 
Clone the ruletree

Returns:
a cloned ruletree
Throws:
java.lang.CloneNotSupportedException

deepCopy

RuleTree deepCopy()
Deprecated. 
Creates a deep copy of the rule tree and all operands,operators,functions & co

Returns:
the newly created RuleTree, or null if it couldn't be copied for any reason.

hasChanged

boolean hasChanged(long timestamp)
Deprecated. 
Check whether the properties evaluated in this ruletree have changed since the given timestamp

Parameters:
timestamp - timestamp in ms
Returns:
true when the properties have changed, false if not

getExpression

Expression getExpression()
Deprecated. 
Get the parsed expression of this ruletree. This will return null when the ruletree is in compatibilityMode.

Returns:
the parsed expression or null


Copyright © 2013 Gentics Software GmbH. All Rights Reserved.