wt.rule.init
Class InitRuleHelper

java.lang.Object
  extended bywt.rule.init.InitRuleHelper

public class InitRuleHelper
extends Object

This class provides utilities that are useful when working with INIT rules.

Supported API: false

Extendable: false


Field Summary
private static String CLASSNAME
           
static InitRuleEvalService evaluator
          

Supported API: false
private static String RESOURCE
           
 
Constructor Summary
InitRuleHelper()
           
 
Method Summary
static AttributeValues getAttributeValues(InputSource source)
          Returns the attribute values specification that results from parsing XML obtained from the specified InputSource.
static AttributeValues getAttributeValues(Object obj, WTContainerRef container)
          Returns the attribute values specification that results from parsing the rule for the specified Object and WTContainerRef.
static AttributeValues getAttributeValues(Rule rule)
          Return the attribute values specification that results from parsing the rule.
static AttrValue getAttrValue(String id, Object obj, WTContainerRef container)
          Get the AttrValue with the specified identifier from the specified INIT Rule for the specified Object and WTContainerRef.
static AttrValue getAttrValue(String id, Rule rule)
          Get the AttrValue from the specified INIT Rule that has the specified identifier.
static boolean hasAttrValue(String id, Object obj, WTContainerRef container)
          Returns true if the specified INIT Rule specifies a value for the attribute with the specified identifier.
static boolean hasAttrValue(String id, Rule rule)
          Returns true if the specified INIT Rule specifies a value for the attribute with the specified identifier.
static AttributeValues mergeAttributeValues(AttributeValues spec1, AttributeValues spec2)
          Merge spec1 into spec2.
static void setContents(Rule rule, AttributeValues spec)
          Set the contents of the (@link wt.rule.Rule} to the XML specified by the AttributeValues.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

evaluator

public static final InitRuleEvalService evaluator


Supported API: false

Constructor Detail

InitRuleHelper

public InitRuleHelper()
Method Detail

getAttributeValues

public static final AttributeValues getAttributeValues(Rule rule)
                                                throws WTException
Return the attribute values specification that results from parsing the rule.

Supported API: false

Parameters:
rule -
Returns:
AttributeValues
Throws:
WTException

getAttributeValues

public static final AttributeValues getAttributeValues(Object obj,
                                                       WTContainerRef container)
                                                throws WTException
Returns the attribute values specification that results from parsing the rule for the specified Object and WTContainerRef.

Supported API: false

Parameters:
obj -
container -
Returns:
AttributeValues
Throws:
WTException

getAttributeValues

public static final AttributeValues getAttributeValues(InputSource source)
                                                throws IOException,
                                                       SAXException
Returns the attribute values specification that results from parsing XML obtained from the specified InputSource.

Supported API: false

Parameters:
source -
Returns:
AttributeValues
Throws:
IOException
SAXException

mergeAttributeValues

public static AttributeValues mergeAttributeValues(AttributeValues spec1,
                                                   AttributeValues spec2)
Merge spec1 into spec2. The values from spec1 overwrite the values in spec2 unless the attribute in spec2 being overwritten is marked as final.

spec1 is modified and returned.

Supported API: false

Parameters:
spec1 -
spec2 -
Returns:
AttributeValues

getAttrValue

public static final AttrValue getAttrValue(String id,
                                           Rule rule)
                                    throws WTException
Get the AttrValue from the specified INIT Rule that has the specified identifier.

Supported API: false

Parameters:
id -
rule -
Returns:
AttrValue
Throws:
WTException

getAttrValue

public static final AttrValue getAttrValue(String id,
                                           Object obj,
                                           WTContainerRef container)
                                    throws WTException
Get the AttrValue with the specified identifier from the specified INIT Rule for the specified Object and WTContainerRef.

Supported API: false

Parameters:
id -
obj -
container -
Returns:
AttrValue
Throws:
WTException

hasAttrValue

public static final boolean hasAttrValue(String id,
                                         Rule rule)
                                  throws WTException
Returns true if the specified INIT Rule specifies a value for the attribute with the specified identifier.

Supported API: false

Parameters:
id -
rule -
Returns:
boolean
Throws:
WTException

hasAttrValue

public static final boolean hasAttrValue(String id,
                                         Object obj,
                                         WTContainerRef container)
                                  throws WTException
Returns true if the specified INIT Rule specifies a value for the attribute with the specified identifier.

Supported API: false

Parameters:
id -
obj -
container -
Returns:
boolean
Throws:
WTException

setContents

public static void setContents(Rule rule,
                               AttributeValues spec)
                        throws IOException,
                               WTPropertyVetoException
Set the contents of the (@link wt.rule.Rule} to the XML specified by the AttributeValues.

The rule is not persisted as part of this operation.

Supported API: false

Parameters:
rule -
spec -
Throws:
IOException
WTPropertyVetoException