|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.util.AbstractXmlObject
com.waveset.object.AttributeCondition
AttributeCondition structures query expressions. Typically contains attribute, operator, and value.
Asserts that:
at least one value of the specified attribute
compares as specified by the operator
to the value(s) of the operand.
Nested Class Summary | |
static class |
AttributeCondition.Operator
A static instance represents each operator supported by the AttributeCondition class. |
Field Summary | |
static java.lang.String |
code_id
|
static java.lang.String |
ELEMENT
|
protected static Trace |
trace
|
Fields inherited from class com.waveset.util.AbstractXmlObject |
_trace |
Constructor Summary | |
protected |
AttributeCondition()
Protected "empty" constructor for the convenience of subclasses and other classes in this package. |
|
AttributeCondition(Attribute attribute,
AttributeCondition.Operator operator,
java.lang.Object operand)
Describes an attribute-value comparison to a string. |
|
AttributeCondition(org.w3c.dom.Element e)
Construct an AttributeCondition from an XML element |
|
AttributeCondition(java.lang.String xml)
Construct an AttributeCondition from an XML string |
|
AttributeCondition(java.lang.String attrName,
AttributeCondition.Operator operator,
java.lang.Object operand)
Describes an attribute-value comparison to a string. |
|
AttributeCondition(java.lang.String attrName,
java.lang.String operatorName,
java.lang.Object operand)
Describes an attribute-value comparison to a string. |
Method Summary | |
int |
compareTo(java.lang.Object o)
|
static AttributeCondition[] |
convert(WSAttributes attrs)
Convert WSAttributes argument to an equivalent array of attribute conditions. |
Attribute |
getAttribute()
|
java.lang.String |
getAttrName()
|
java.lang.String |
getAttrNameIgnoreCase()
|
java.lang.String |
getElementName()
Return the element name. |
java.lang.Object |
getOperand()
|
java.lang.String |
getOperandAsString()
|
java.lang.String |
getOperandIgnoreCase()
|
AttributeCondition.Operator |
getOperator()
|
boolean |
isMetBy(AttributeValues attrVals)
|
boolean |
isMetBy(java.lang.Object attrVal)
Evaluate this attribute condition against the value. |
boolean |
isMetBy(java.lang.String stringAttrVal)
Evaluate this attribute condition against the value. |
boolean |
isMetBy(WSAttribute attr)
Test whether the input attribute meets this attribute condition. |
boolean |
isMetBy(WSAttributes attrs)
|
static void |
main(java.lang.String[] args)
|
void |
parseXml(org.w3c.dom.Element e)
|
void |
parseXml(java.lang.String xml)
|
static void |
println(java.lang.Object o)
Ubiquitous macro. |
static AttributeCondition[] |
toArray(WSAttributes attrs)
Convert WSAttributes into an array of AttributeConditions. |
java.lang.String |
toLdapSearchFilter()
|
static java.util.List |
toList(java.util.Map attrs)
Convert a Map of name/value pairs into a List of conditions. |
static java.util.List |
toList(WSAttributes attrs)
Convert WSAttributes into a List of conditions. |
java.lang.String |
toLocalizedString(java.util.Locale locale)
Build a summary of AttributeConditions from the view |
java.lang.String |
toString()
|
void |
toXml(java.lang.StringBuffer b)
Convert this AttributeCondition to an XML string adding it to the provided buffer. |
void |
toXml(java.lang.StringBuffer b,
int indent)
Convert this AttributeCondition to an XML string adding it to the provided buffer at the specified indent level |
Methods inherited from class com.waveset.util.AbstractXmlObject |
addXmlHeader, cloneObject, dump, dumpFile, getReference, setTrace, toIdentityString, toVerboseString, toVerboseString, toXml, toXml |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
protected static Trace trace
public static final java.lang.String ELEMENT
Constructor Detail |
protected AttributeCondition()
public AttributeCondition(java.lang.String attrName, AttributeCondition.Operator operator, java.lang.Object operand)
attrName
- - the name of the attribute to be comparedoperator
- - the comparison to be madeoperand
- - compare to this value.
String
,
except when the operator is Operator.IS_ONE_OF
(A.K.A. Operator.IN
).
In this case, the operand must be a List
.
Each item in the list is treated as a String
.
NOTE: equality and ordinality comparisons are lexical and case-insensitive.
public AttributeCondition(Attribute attribute, AttributeCondition.Operator operator, java.lang.Object operand)
attribute
- - a handle to the attribute to be comparedoperator
- - the comparison to be madeoperand
- - compare to this value
NOTE: equality and ordinality comparisons are lexical and case-insensitive.
public AttributeCondition(java.lang.String attrName, java.lang.String operatorName, java.lang.Object operand)
attrName
- - the name of the attribute to be compared.operatorName
- - the (name of the) comparison to be made.operand
- - compare to this value.
String
,
except when the operator is Operator.IS_ONE_OF
(A.K.A. Operator.IN
).
In this case, the operand must be a List
.
Each item in the list is treated as a String
.
NOTE: equality and ordinality comparisons are lexical and case-insensitive.
public AttributeCondition(java.lang.String xml) throws WavesetException
xml
- - an AttributeCondition serialized as an XML string.public AttributeCondition(org.w3c.dom.Element e) throws WavesetException
e
- - the XML representation of the AttributeCondition to be
createdMethod Detail |
public Attribute getAttribute()
public java.lang.String getAttrName()
public java.lang.String getAttrNameIgnoreCase()
public AttributeCondition.Operator getOperator()
public java.lang.Object getOperand()
public java.lang.String getOperandAsString()
public java.lang.String getOperandIgnoreCase()
public java.lang.String toString()
public java.lang.String toLocalizedString(java.util.Locale locale)
public java.lang.String toLdapSearchFilter()
toLdapSearchFilter
in interface AttributeExpression
public boolean isMetBy(WSAttributes attrs)
isMetBy
in interface AttributeExpression
true
if the attribute expression
evaluates to true for the specified attribute values;
otherwise false
.public boolean isMetBy(WSAttribute attr)
For multi-valued attributes, this is a "subset" comparison,
public boolean isMetBy(AttributeValues attrVals)
public boolean isMetBy(java.lang.Object attrVal)
attrVal
- - the value to test.
public boolean isMetBy(java.lang.String stringAttrVal)
java.lang.IllegalArgumentException
- if the attribute condition
has been improperly initialized.public static final AttributeCondition[] convert(WSAttributes attrs)
public static final java.util.List toList(WSAttributes attrs)
public static final AttributeCondition[] toArray(WSAttributes attrs)
public static final java.util.List toList(java.util.Map attrs)
public java.lang.String getElementName()
AbstractXmlObject
getElementName
in interface XmlObject
getElementName
in class AbstractXmlObject
public void toXml(java.lang.StringBuffer b)
toXml
in class AbstractXmlObject
b
- - the buffer to append the XML string to
Merely invokes toXml(b, 0).
public void toXml(java.lang.StringBuffer b, int indent)
toXml
in interface XmlObject
toXml
in class AbstractXmlObject
b
- - the buffer to append the XML string toindent
- - how many spaces to indent the XMLpublic void parseXml(java.lang.String xml) throws WavesetException
WavesetException
public void parseXml(org.w3c.dom.Element e) throws WavesetException
WavesetException
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public static void println(java.lang.Object o)
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |