public class DiscriminatorRule extends Rule
Rule
that applies under certain conditions but not under other conditions. The conditions are specified in an object that implements the Discriminator
interface.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
a_type |
protected java.util.Hashtable |
m_context |
protected static java.lang.String |
NAME_DISCRULE |
m_mergeable, RESET_EVERYTHING, RESET_NONE, RESET_XML_PROPERTIES
Constructor and Description |
---|
DiscriminatorRule()
Constructor that does not specify a
Discriminator . |
DiscriminatorRule(Discriminator discriminator, Mergeable mergeable)
Constructor that specifies a
Discriminator and a Mergeable object. |
Modifier and Type | Method and Description |
---|---|
boolean |
applies(RuleContext context, Mergeable target)
Indicates whether this
DiscriminatorRule applies. |
java.lang.Object |
clone()
Clones this object.
|
boolean |
equals(java.lang.Object o)
Indicates whether the specified object is equivalent to this
DiscriminatorRule . |
Discriminator |
getDiscriminator()
Retrieves the
Discriminator of this DiscriminatorRule . |
oracle.dss.util.xml.ObjectNode |
getXML(boolean allProperties, ComponentTypeConverter dataview)
Retrieves XML that represents properties and their values in the form of and
ObjectNode . |
void |
setContext(java.util.Hashtable context) |
void |
setDiscriminator(Discriminator discriminator)
Specifies the
Discriminator for this DiscriminatorRule . |
boolean |
setXML(oracle.dss.util.xml.ObjectNode node, ComponentTypeConverter converter, java.lang.String version, int reset)
Specifies XML that represents properties and values.
|
fireRule, getFixedMergeable, getID, runRule, setFixedMergeable, setID, setXML
public static final java.lang.String a_type
protected java.util.Hashtable m_context
protected static final java.lang.String NAME_DISCRULE
public DiscriminatorRule()
Discriminator
. If you use this constructor, call the setDiscriminator
method to specify a Discriminator
. Call the setFixedMergeable
object of the superclass to specify the Mergeable
object that has the appropriate properties set.public DiscriminatorRule(Discriminator discriminator, Mergeable mergeable)
Discriminator
and a Mergeable
object.discriminator
- The object that specifies the conditions under which this Rule
applies.mergeable
- The object that specifies the property values that should be set when this Rule
applies.public java.lang.Object clone()
public boolean applies(RuleContext context, Mergeable target)
DiscriminatorRule
applies. This method actually calls the applies
method of the Discriminator
for this DiscriminatorRule
and returns its result.applies
in class Rule
context
- The context of the item that is to be painted. The Discriminator
compares this context with its condition. The Dataview
provides this parameter.target
- The Mergeable
object whose properties will be modified when the rule is fired, if this method returns true
. Overriding methods may or may not use this parameter. This must be the same class as the object retrieved by calling the getFixedMergeable
method.true
if the applies
method of the Discriminator
returns true
, false
if it returns false
or if there is no Discriminator
specified for this DiscriminatorRule
.public Discriminator getDiscriminator()
Discriminator
of this DiscriminatorRule
.Discriminator
that specifies the conditions under which this DiscriminatorRule
applies.public void setDiscriminator(Discriminator discriminator)
Discriminator
for this DiscriminatorRule
.discriminator
- A Discriminator
object that specifies the conditions under which this DiscriminatorRule
applies.public boolean equals(java.lang.Object o)
DiscriminatorRule
. The objects are equivalent when both the Discriminator
objects and the Mergeable
objects for the two DiscriminatorRules
are equivalent. Null Discriminator
objects are equivalent, and null Mergeable
objects are equivalent.equals
in class java.lang.Object
o
- The object to compare with this DiscriminatorRule
.true
if the rules have equivalent discriminators and equivalent Mergeable
objects, false
if not or if o
is null.public void setContext(java.util.Hashtable context)
context
- A hashtable that a user can use to pass XMLContext One can also use this table to pass more information to its objects.public boolean setXML(oracle.dss.util.xml.ObjectNode node, ComponentTypeConverter converter, java.lang.String version, int reset)
DiscriminatorRule
.node
- ObjectNode
that has the properties and their values.version
- The XML version.reset
- A constant that indicates how much to reset when XML is applied. Valid values are listed in the See Also section.true
if XML is properly applied, false
if the XML cannot be applied.Rule.RESET_NONE
, Rule.RESET_XML_PROPERTIES
, Rule.RESET_EVERYTHING
public oracle.dss.util.xml.ObjectNode getXML(boolean allProperties, ComponentTypeConverter dataview)
ObjectNode
.