|
|||||||||
| Home >> All >> org >> apache >> slide >> search >> [ basic overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.slide.search.basic
Class NotNormalizer

java.lang.Objectorg.apache.slide.search.basic.NotNormalizer
- public class NotNormalizer
- extends java.lang.Object
This class recursivly removes all <not> expressions
and replaces their successors by appropriate negated expressions. Since
an example explains more than a thousand words:
<D:not>
<D:or>
<D:lt>
<D:prop>
<D:getcontentlength>
</D:prop>
<D:literal>1000</D:literal>
</D:lt>
<D:eq>
<D:prop>
<D:getcontenttype>
</D:prop>
<D:literal>text/xml</D:literal>
</D:eq>
</D:or>
</D:not>
will be transformed to
<D:and>
<D:not-lt>
<D:prop>
<D:getcontentlength>
</D:prop>
<D:literal>1000</D:literal>
</D:not-lt>
<D:not-eq>
<D:prop>
<D:getcontenttype>
</D:prop>
<D:literal>text/xml</D:literal>
</D:not-eq>
</D:and>
- Version:
- $Revision: 1.6 $
| Field Summary | |
static java.lang.String |
BAD_NOT_EXPRESSION_EXCEPTION_MESSAGE
The message of the InvalidQueryException which is thrown by getQueryWithoutNotExpression 55 if a <not> expression has
NOT exactly one successor. |
| Constructor Summary | |
NotNormalizer()
|
|
| Method Summary | |
protected org.jdom.Element |
getNamedClone(org.jdom.Element source,
java.lang.String newName,
org.jdom.Namespace newNamespace)
Creates a new Element with the given newName in the
newNamespace and sets the value (text) and attributes
of the given source element. |
protected org.jdom.Element |
getNegatedDAVQueryElement(org.jdom.Element expressionElement)
Returns the negation of the given expressionElement,
which is in the DAV: namespace. |
protected org.jdom.Element |
getNegatedQueryElement(org.jdom.Element expressionElement)
Returns the negation of the given expressionElement. |
protected org.jdom.Element |
getNegatedSlideQueryElement(org.jdom.Element expressionElement)
Returns the negation of the given expressionElement,
which is in the http://jakarta.apache.org/slide/ namespace. |
protected org.jdom.Element |
getNegatedUnknownQueryElement(org.jdom.Element expressionElement)
Returns the negation of the given expressionElement,
which is neither in DAV: nor
http://jakarta.apache.org/slide/ namespace. |
protected org.jdom.Element |
getProcessedElement(org.jdom.Element expressionElement,
boolean negate)
Returns the appropriate replacement for the given expressionElement. |
org.jdom.Element |
getQueryWithoutNotExpression(org.jdom.Element expressionElement)
Returns the transformed query where all <not> elements
has been removed. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
BAD_NOT_EXPRESSION_EXCEPTION_MESSAGE
public static final java.lang.String BAD_NOT_EXPRESSION_EXCEPTION_MESSAGE
- The message of the InvalidQueryException which is thrown by getQueryWithoutNotExpression 55 if a
<not>expression has NOT exactly one successor.- See Also:
- Constant Field Values
| Constructor Detail |
NotNormalizer
public NotNormalizer()
| Method Detail |
getQueryWithoutNotExpression
public org.jdom.Element getQueryWithoutNotExpression(org.jdom.Element expressionElement) throws org.apache.slide.search.BadQueryException
- Returns the transformed query where all
<not>elements has been removed.
getProcessedElement
protected org.jdom.Element getProcessedElement(org.jdom.Element expressionElement, boolean negate) throws org.apache.slide.search.BadQueryException
- Returns the appropriate replacement for the given
expressionElement. Ifnegateis true, the Element has to be negated.
getNegatedQueryElement
protected org.jdom.Element getNegatedQueryElement(org.jdom.Element expressionElement) throws org.apache.slide.search.BadQueryException
- Returns the negation of the given
expressionElement.
getNegatedUnknownQueryElement
protected org.jdom.Element getNegatedUnknownQueryElement(org.jdom.Element expressionElement) throws org.apache.slide.search.BadQueryException
- Returns the negation of the given
expressionElement, which is neither inDAV:norhttp://jakarta.apache.org/slide/namespace.
getNegatedDAVQueryElement
protected org.jdom.Element getNegatedDAVQueryElement(org.jdom.Element expressionElement) throws org.apache.slide.search.BadQueryException
- Returns the negation of the given
expressionElement, which is in theDAV:namespace.
getNegatedSlideQueryElement
protected org.jdom.Element getNegatedSlideQueryElement(org.jdom.Element expressionElement) throws org.apache.slide.search.BadQueryException
- Returns the negation of the given
expressionElement, which is in thehttp://jakarta.apache.org/slide/namespace.
getNamedClone
protected org.jdom.Element getNamedClone(org.jdom.Element source, java.lang.String newName, org.jdom.Namespace newNamespace)
- Creates a new Element with the given
newNamein thenewNamespaceand sets the value (text) and attributes of the givensourceelement.
|
|||||||||
| Home >> All >> org >> apache >> slide >> search >> [ basic overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.apache.slide.search.basic.NotNormalizer