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

## com.novell.xml.xpath
Interface ExpressionValue

All Known Implementing Classes:
  BooleanValue, InsertionOrderNodeSet, JavaObject, JavaVoid, NodeSet, NumberValue, ResultTreeFragment, StringValue

    public interface ExpressionValue

Interface allowing discovery of and access to expression values. Implementing classes must provide an argumentless constructor for use in casting expression types. For casting, the appropriate type is constructed, then the castFrom() member defined by this interface is called.

Field Summary
`static int` | `BOOLEAN` Represents a boolean value
`static int` | `EXTENDED` Represents a non-XPath defined type
`static int` | `NATIVE` Represents a native (extension) type
`static int` | `NODE_SET` Represents a node-set value
`static int` | `NUMBER` Represents a number value
`static int` | `STRING` Represents a string value

Method Summary
`void` | `castFrom(Object type)` Convert from a different type of expression value to the type of the class implementing the ExpressionValue interface.
`void` | `dump(PrintWriter writer)` Output a human-readable form for the value
`boolean` | `getBooleanValue()` Return boolean value of expression value (will convert to boolean if value is not of type boolean)
`Object` | `getNativeValue()` return the underlying native value (java.lang.Boolean, java.lang.Double, etc.)
`NodeSet` | `getNodeSetValue()` Return node-set value of this ExpressionValue.
`double` | `getNumberValue()` Return numeric value of ExpressionValue.
`String` | `getStringValue()` Return string value of this ExpressionValue.
`int` | `getValueType()` Return type of expression value

Field Detail

### BOOLEAN

    static final int BOOLEAN

  Represents a boolean value

  See Also:
    Constant Field Values

### NUMBER

    static final int NUMBER

  Represents a number value

  See Also:
    Constant Field Values

### STRING

    static final int STRING

  Represents a string value

  See Also:
    Constant Field Values

### NODE_SET

    static final int NODE_SET

  Represents a node-set value

  See Also:
    Constant Field Values

### EXTENDED

    static final int EXTENDED

  Represents a non-XPath defined type

  See Also:
    Constant Field Values

### NATIVE

    static final int NATIVE

  Represents a native (extension) type

  See Also:
    Constant Field Values

Method Detail

### getValueType

    int getValueType()

  Return type of expression value

  Returns:
    ExpressionValue.BOOLEAN, ExpressionValue.NUMBER, etc.

### castFrom

    void castFrom(Object type)
                  throws XPathConversionException

  Convert from a different type of expression value to the type of the class implementing the ExpressionValue interface. This is used primarily for converting parameters for function calls. The XPath basic types (Boolean, Number, String, Node-set) use the required methods of ExpressionValue to perform this function. Extended types must implement this according to their language definitions.

  Parameters:
    `type` - The object to convert from.
  Throws:
    `XPathConversionException`

### getBooleanValue

    boolean getBooleanValue()
                            throws XPathConversionException

  Return boolean value of expression value (will convert to boolean if value is not of type boolean)

  Returns:
    true or false
  Throws:
    `XPathConversionException`

### getNumberValue

    double getNumberValue()
                          throws XPathConversionException

  Return numeric value of ExpressionValue. Will convert to a number if value is not of NUMBER type

  Returns:
    numeric value
  Throws:
    `XPathConversionException`

### getStringValue

    String getStringValue()

  Return string value of this ExpressionValue. Will convert to a string if underlying type is not string.

  Returns:
    String value of ExpressionValue

### getNodeSetValue

    NodeSet getNodeSetValue()
                            throws XPathConversionException

  Return node-set value of this ExpressionValue. Will NOT convert an underlying type to a node-set.

  Throws:
    `XPathConversionException`

### getNativeValue

    Object getNativeValue()

  return the underlying native value (java.lang.Boolean, java.lang.Double, etc.)

  Returns:
    The native java class that is the value

### dump

    void dump(PrintWriter writer)

  Output a human-readable form for the value

  Parameters:
    `writer` - Output device

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