org.jaxen.saxpath.Axis Java Examples

The following examples show how to use org.jaxen.saxpath.Axis. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SolrXPathHandler.java    From SearchServices with GNU Lesser General Public License v3.0 6 votes vote down vote up
public void startAllNodeStep(int axis) throws SAXPathException
{
    switch (axis)
    {
    case Axis.CHILD:
        if (isAbsolutePath)
        {
            // addAbsolute(null, null);
            // We can always do relative stuff
            addRelative(null, null);
        }
        else
        {
            addRelative(null, null);
        }
        break;
    case Axis.DESCENDANT_OR_SELF:
        query.appendQuery(getArrayList(new DescendantAndSelfStructuredFieldPosition(), new DescendantAndSelfStructuredFieldPosition()));
        break;
    case Axis.SELF:
        query.appendQuery(getArrayList(new SelfAxisStructuredFieldPosition(), new SelfAxisStructuredFieldPosition()));
        break;
    default:
        throw new UnsupportedOperationException();
    }
}
 
Example #2
Source File: SolrXPathHandler.java    From SearchServices with GNU Lesser General Public License v3.0 6 votes vote down vote up
public void startNameStep(int axis, String nameSpace, String localName) throws SAXPathException
{
    switch (axis)
    {
    case Axis.CHILD:
        if (isAbsolutePath)
        {
            // addAbsolute(nameSpace, localName);
            // we can always do relative stuff
            addRelative(nameSpace, localName);
        }
        else
        {
            addRelative(nameSpace, localName);
        }
        break;
    default:
        throw new UnsupportedOperationException();
    }

}
 
Example #3
Source File: MCRNodeBuilder.java    From mycore with GNU General Public License v3.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
private Object buildNameStep(NameStep nameStep, String value, Parent parent) throws JaxenException {
    String name = nameStep.getLocalName();
    String prefix = nameStep.getPrefix();
    Namespace ns = prefix.isEmpty() ? Namespace.NO_NAMESPACE : MCRConstants.getStandardNamespace(prefix);

    if (nameStep.getAxis() == Axis.CHILD) {
        if (parent instanceof Document) {
            return buildPredicates(nameStep.getPredicates(), ((Document) parent).getRootElement());
        } else {
            return buildPredicates(nameStep.getPredicates(), buildElement(ns, name, value, (Element) parent));
        }
    } else if (nameStep.getAxis() == Axis.ATTRIBUTE) {
        return buildAttribute(ns, name, value, (Element) parent);
    } else {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("ignoring axis, can not be built: {} {}{}", nameStep.getAxis(),
                prefix.isEmpty() ? "" : prefix + ":", name);
        }
        return null;
    }
}
 
Example #4
Source File: DebugXPathHandler.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void startAllNodeStep(int arg0) throws SAXPathException
{
    System.out.println("Start All Node Exp: Axis = " + Axis.lookup(arg0));
}
 
Example #5
Source File: DebugXPathHandler.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void startNameStep(int arg0, String arg1, String arg2) throws SAXPathException
{
    System.out.println("Start Name Step Axis = <" + Axis.lookup(arg0) + " > arg1 = < " + arg1 + " > arg 2 <" + arg2
            + " >");
}