Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jaxen.function
Class NameFunction

    java.lang.Object
      org.jaxen.function.NameFunction

All Implemented Interfaces:
  Function

public class NameFunction
extends Object
implements Function

4.1 `string name(node-set?)`

> The name function returns a string containing a QName representing the expanded-name of the node in the argument node-set that is first in document order. The QName must represent the expanded-name with respect to the namespace declarations in effect on the node whose expanded-name is being represented. Typically, this will be the QName that occurred in the XML source....If the argument node-set is empty or the first node has no expanded-name, an empty string is returned. If the argument it omitted, it defaults to a node-set with the context node as its only member.

Author:
  bob mcwhirter (bob @ werken.com)
See Also:
  Section 4.1 of the XPath Specification

Constructor Summary
`NameFunction()` Create a new `NameFunction` object.

Method Summary
`Object` | `call(Context context, List args)` Returns the name of the specified node or the name of the context node if no arguments are provided.
`static String` | `evaluate(List list, Navigator nav)` Returns the name of `list.get(0)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### NameFunction

    public NameFunction()

  Create a new `NameFunction` object.

Method Detail

### call

    public Object call(Context context,
                       List args)
                throws FunctionCallException

  Returns the name of the specified node or the name of the context node if no arguments are provided.

  Specified by:
    `call` in interface `Function`
  Parameters:
    `context` - the context at the point in the expression where the function is called
    `args` - a `List` containing zero or one items
  Returns:
    a `String` containing the name
  Throws:
    `FunctionCallException` - if `args` has more than one item

### evaluate

    public static String evaluate(List list,
                                  Navigator nav)
                           throws FunctionCallException

  Returns the name of `list.get(0)`

  Parameters:
    `list` - a list of nodes
    `nav` - the `Navigator` used to retrieve the name
  Returns:
    the name of `list.get(0)`
  Throws:
    `FunctionCallException` - if `list.get(0)` is not a node

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005 Codehaus. All Rights Reserved.