|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttigase.jaxmpp.core.client.criteria.ElementCriteria
public class ElementCriteria
Simple implementation of Criteria to check element name and its attributes..
| Field Summary | |
|---|---|
protected HashMap<String,String> |
attrs
|
protected String |
name
|
protected Criteria |
nextCriteria
|
| Constructor Summary | |
|---|---|
ElementCriteria(String name,
String[] attname,
String[] attValue)
Construct criteria. |
|
| Method Summary | |
|---|---|
Criteria |
add(Criteria criteria)
Adds restriction for deeper level of elements. |
static ElementCriteria |
empty()
Makes criteria object what accepts all elements. |
boolean |
match(Element element)
This method checks if element match to conditions. |
static ElementCriteria |
name(String name)
Makes criteria object to check name of element. |
static ElementCriteria |
name(String name,
String xmlns)
Makes criteria object to check name of element and its namespace. |
static ElementCriteria |
name(String name,
String[] attNames,
String[] attValues)
|
static ElementCriteria |
xmlns(String xmlns)
Makes criteria checking only xmlns attribute. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected HashMap<String,String> attrs
protected String name
protected Criteria nextCriteria
| Constructor Detail |
|---|
public ElementCriteria(String name,
String[] attname,
String[] attValue)
name - name of element. If null then any elements name
will be accepted;attname - names of required attributesattValue - value of requird attrivutes| Method Detail |
|---|
public static final ElementCriteria empty()
public static final ElementCriteria name(String name)
name - expected element name.
public static final ElementCriteria name(String name,
String xmlns)
name - expected name of element.xmlns - expected xmlns
public static final ElementCriteria name(String name,
String[] attNames,
String[] attValues)
public static final ElementCriteria xmlns(String xmlns)
xmlns - expected xmlns
public Criteria add(Criteria criteria)
For example:
If you have structure of elements:
<A><B></B></A>
then, to check elements A and B you should use
construction like this: critToCheckA.add(critToCheckB);
add in interface Criteriacriteria - restriction to add
public boolean match(Element element)
throws XMLException
match in interface Criteriaelement - element to check
true if element match.
XMLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||