|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.bridge.util.xml.query.QueryReader
public abstract class QueryReader
This class contains static methods related to creating a Query object using a (fragment of an) XML.
| Field Summary | |
|---|---|
static String |
NAMESPACE_SEARCHQUERY
most recent version |
static String |
NAMESPACE_SEARCHQUERY_1_0
|
static String |
XSD_SEARCHQUERY_1_0
|
| Constructor Summary | |
|---|---|
QueryReader()
|
|
| Method Summary | |
|---|---|
protected static void |
addConstraint(Element constraintElement,
QueryDefinition queryDefinition,
CompositeConstraint parentConstraint)
|
protected static void |
addDistinct(Element distinctElement,
QueryDefinition queryDefinition)
|
protected static void |
addField(Element fieldElement,
QueryDefinition queryDefinition,
QueryConfigurer configurer)
|
protected static void |
addSortOrder(Element sortOrderElement,
QueryDefinition queryDefinition)
|
protected static Constraint |
getAgeConstraint(Element constraintElement,
QueryDefinition queryDefinition)
|
protected static Integer |
getAlias(Cloud cloud,
String name)
|
protected static Constraint |
getAliasConstraint(Element constraintElement,
QueryDefinition queryDefinition)
|
protected static SortedSet<Integer> |
getAliases(Cloud cloud,
List<String> names)
|
static String |
getAttribute(Element element,
String localName)
Returns the value of a certain attribute, either an unqualified attribute or an attribute that fits in the searchquery namespace |
protected static Constraint |
getCompositeConstraint(Element constraintElement,
QueryDefinition queryDefinition)
|
protected static Constraint |
getConstraint(Element constraintElement,
QueryDefinition queryDefinition)
|
protected static int |
getDayMark(Cloud cloud,
int age)
|
protected static String |
getFullFieldName(QueryDefinition queryDefinition,
String fieldName)
|
protected static SortedSet<Integer> |
getOTypes(Cloud cloud,
List<String> names,
boolean descendants)
|
protected static Constraint |
getTypeConstraint(Element constraintElement,
QueryDefinition queryDefinition)
|
static boolean |
hasAttribute(Element element,
String localName)
Returns whether an element has a certain attribute, either an unqualified attribute or an attribute that fits in the searchquery namespace |
static QueryDefinition |
parseQuery(Element queryElement,
Cloud cloud,
String relateFrom)
As parseQuery(Element, QueryConfigurer, Cloud, String), but with default QueryConfigurer |
static QueryDefinition |
parseQuery(Element queryElement,
QueryConfigurer configurer,
Cloud cloud,
String relateFrom)
Creates a Query object from an Element. |
static void |
registerSystemIDs()
Register the namespace and XSD used by QueryReader This method is called by EntityResolver. |
protected static Object |
resolveVariables(String s,
QueryDefinition queryDefinition)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String XSD_SEARCHQUERY_1_0
public static final String NAMESPACE_SEARCHQUERY_1_0
public static final String NAMESPACE_SEARCHQUERY
| Constructor Detail |
|---|
public QueryReader()
| Method Detail |
|---|
public static void registerSystemIDs()
public static boolean hasAttribute(Element element,
String localName)
public static String getAttribute(Element element,
String localName)
protected static String getFullFieldName(QueryDefinition queryDefinition,
String fieldName)
protected static void addField(Element fieldElement,
QueryDefinition queryDefinition,
QueryConfigurer configurer)
protected static Object resolveVariables(String s,
QueryDefinition queryDefinition)
protected static Constraint getConstraint(Element constraintElement,
QueryDefinition queryDefinition)
protected static int getDayMark(Cloud cloud,
int age)
protected static Constraint getAgeConstraint(Element constraintElement,
QueryDefinition queryDefinition)
protected static Integer getAlias(Cloud cloud,
String name)
protected static SortedSet<Integer> getAliases(Cloud cloud,
List<String> names)
protected static Constraint getAliasConstraint(Element constraintElement,
QueryDefinition queryDefinition)
protected static SortedSet<Integer> getOTypes(Cloud cloud,
List<String> names,
boolean descendants)
protected static Constraint getTypeConstraint(Element constraintElement,
QueryDefinition queryDefinition)
protected static Constraint getCompositeConstraint(Element constraintElement,
QueryDefinition queryDefinition)
throws SearchQueryException
SearchQueryException
protected static void addConstraint(Element constraintElement,
QueryDefinition queryDefinition,
CompositeConstraint parentConstraint)
throws SearchQueryException
SearchQueryException
protected static void addDistinct(Element distinctElement,
QueryDefinition queryDefinition)
protected static void addSortOrder(Element sortOrderElement,
QueryDefinition queryDefinition)
public static QueryDefinition parseQuery(Element queryElement,
Cloud cloud,
String relateFrom)
throws SearchQueryException
parseQuery(Element, QueryConfigurer, Cloud, String), but with default QueryConfigurer
SearchQueryException
public static QueryDefinition parseQuery(Element queryElement,
QueryConfigurer configurer,
Cloud cloud,
String relateFrom)
throws SearchQueryException
QueryDefinition and
you can simply access the QueryDefinition.query member to have the actual Query.
queryElement - Any XML element which query sub-tags and attributes.configurer - The configure which is responsible for instantiating the QueryDefinitioncloud - Cloud, needed to make Query objects.relateFrom - (optional) name of a node manager which can be used to base the query on, as the first element of the path (can be null)
SearchQueryException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||