Package org.jaxen

Examples of org.jaxen.Navigator


  public static final QName QNAME = new QName("http://incubator.apache.org/abdera", "resolve");
 
  public Object call(Context context, List args) throws FunctionCallException {
    List<IRI> results = new ArrayList<IRI>();
    if (args.isEmpty()) return null;
    Navigator navigator = context.getNavigator();
    for(Object obj : args) {
      if (obj instanceof List) {
        for (Object o : (List)obj) {
          try {
            String value = StringFunction.evaluate(o, navigator);
View Full Code Here


            log.warn("Synapse context has not been set for the XPath extension function" +
                "'synapse:get-property(prop-name)'");
            return null;

        } else {
            Navigator navigator = context.getNavigator();
            Iterator iter = args.iterator();
            while (iter.hasNext()) {
                String key = StringFunction.evaluate(iter.next(), navigator);
                // ignore if more than one argument has been specified
                Object result = synCtx.getProperty(key);
View Full Code Here

    public boolean matches(Object node,
                           ContextSupport contextSupport)
    {
        //System.err.println( "DefaultNameStep.matches(" + node + ")" );

        Navigator nav  = contextSupport.getNavigator();

        String  myPrefix  = getPrefix();        
        String  myUri     = null;
        boolean hasPrefix = ( myPrefix != null ) && (! ( "".equals( myPrefix ) ) );

        String nodeUri  = null;
        String nodeName = null;

        if ( nav.isElement( node ) )
        {
            nodeUri  = nav.getElementNamespaceUri( node );
            nodeName = nav.getElementName( node );
        }
        else if ( nav.isAttribute( node ) )
        {
            nodeUri  = nav.getAttributeNamespaceUri( node );
            nodeName = nav.getAttributeName( node );
        }
        else if ( nav.isDocument( node ) )
        {
            return ( ! hasPrefix ) && matchesAnyName;
        }
        else if ( nav.isNamespace( node ) )
        {
            nodeUri = null;
            nodeName = nav.getNamespacePrefix( node );
        }
        else
        {
            // * will only match elements on most axis
            return false;
View Full Code Here

    }

    public Object evaluate(Context context) throws JaxenException
    {
        ContextSupport support = context.getContextSupport();
        Navigator      nav     = support.getNavigator();

        Context absContext = new Context( support );

       
        List contextNodes = context.getNodeSet();

        if ( contextNodes.isEmpty() )
        {
            return Collections.EMPTY_LIST;
        }

        Object firstNode = contextNodes.get( 0 );

        Object docNode   = nav.getDocumentNode( firstNode );

        if ( docNode == null )
        {
            return Collections.EMPTY_LIST;
        }
View Full Code Here

  public Object evaluate( Context context ) throws JaxenException
    {
    Object lhsValue = getLHS().evaluate( context );
    Object rhsValue = getRHS().evaluate( context );
    Navigator nav = context.getNavigator();

    if( bothAreSets( lhsValue, rhsValue ) )
      {
      return evaluateSetSet( (List) lhsValue, (List) rhsValue, nav );
      }
View Full Code Here

        return "[(DefaultAndExpr): " + getLHS() + ", " + getRHS() + "]";
    }

    public Object evaluate(Context context) throws JaxenException
    {
        Navigator nav = context.getNavigator();
        Boolean lhsValue = BooleanFunction.evaluate( getLHS().evaluate( context ), nav );

        if ( lhsValue == Boolean.FALSE )
        {
            return Boolean.FALSE;
View Full Code Here

        return "[(DefaultOrExpr): " + getLHS() + ", " + getRHS() + "]";
    }

    public Object evaluate(Context context) throws JaxenException
    {
        Navigator nav = context.getNavigator();
        Boolean lhsValue = BooleanFunction.evaluate( getLHS().evaluate( context ), nav );

        if ( lhsValue == Boolean.TRUE )
        {
            return Boolean.TRUE;
View Full Code Here

    if( lhsValue == null || rhsValue == null )
      {
      return Boolean.FALSE;
      }
   
    Navigator nav = context.getNavigator();

    if( bothAreSets( lhsValue, rhsValue ) )
      {
      return evaluateSetSet( (List) lhsValue, (List) rhsValue, nav );
      }
View Full Code Here

       
    /** @return true if the pattern matches the given node
      */
    public boolean matches( Object node, Context context )
    {
        Navigator navigator = context.getNavigator();
        String uri = getURI( node, context );
       
        if ( nodeType == Pattern.ELEMENT_NODE )
        {
            return navigator.isElement( node )
                && uri.equals( navigator.getElementNamespaceUri( node ) );
        }
        else if ( nodeType == Pattern.ATTRIBUTE_NODE )
        {
            return navigator.isAttribute( node )
                && uri.equals( navigator.getAttributeNamespaceUri( node ) );
        }
        return false;
    }
View Full Code Here

       
    /** @return true if the pattern matches the given node
      */
    public boolean matches( Object node, Context context )
    {
        Navigator navigator = context.getNavigator();
        if ( nodeType == Pattern.ELEMENT_NODE )
        {
            return navigator.isElement( node )
                && name.equals( navigator.getElementName( node ) );
        }
        else if ( nodeType == Pattern.ATTRIBUTE_NODE )
        {
            return navigator.isAttribute( node )
                && name.equals( navigator.getAttributeName( node ) );
        }
        else
        {
            if ( navigator.isElement( node ) )
            {
                return name.equals( navigator.getElementName( node ) );
            }
            else
            if ( navigator.isAttribute( node ) )
            {
                return name.equals( navigator.getAttributeName( node ) );
            }
        }
        return false;
    }
View Full Code Here

TOP

Related Classes of org.jaxen.Navigator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.