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

## net.sf.saxon.expr
Class RoleLocator

    java.lang.Object
      net.sf.saxon.expr.RoleLocator

All Implemented Interfaces:
  java.io.Serializable

public class RoleLocator
extends java.lang.Object
implements java.io.Serializable

A RoleLocator identifies the role in which an expression is used, for example as the third argument of the concat() function. This information is stored in an ItemChecker or CardinalityChecker so that good diagnostics can be achieved when run-time type errors are detected.

See Also:
  Serialized Form

Field Summary
`static int` | `BINARY_EXPR`
`static int` | `FUNCTION`
`static int` | `FUNCTION_RESULT`
`static int` | `INSTRUCTION`
`static int` | `ORDER_BY`
`static int` | `TEMPLATE_RESULT`
`static int` | `TYPE_OP`
`static int` | `VARIABLE`

Constructor Summary
`RoleLocator(int kind, java.lang.Object container, int operand, NamePool namePool)` Create information about the role of a subexpression within its parent expression

Method Summary
`java.lang.String` | `composeErrorMessage(ItemType requiredItemType, ItemType suppliedItemType, NamePool pool)` Construct a full error message
`java.lang.String` | `getErrorCode()` Get the error code to be produced if a type error is detected
`java.lang.String` | `getMessage()` Construct and return the error message indicating a type error
`javax.xml.transform.SourceLocator` | `getSourceLocator()` Get the source location (if known - return null if not known)
`void` | `setErrorCode(java.lang.String code)` Set the error code to be produced if a type error is detected
`void` | `setSourceLocator(javax.xml.transform.SourceLocator locator)` Set the source location

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

Field Detail

### FUNCTION

    public static final int FUNCTION

See Also:
  Constant Field Values

### BINARY_EXPR

    public static final int BINARY_EXPR

See Also:
  Constant Field Values

### TYPE_OP

    public static final int TYPE_OP

See Also:
  Constant Field Values

### VARIABLE

    public static final int VARIABLE

See Also:
  Constant Field Values

### INSTRUCTION

    public static final int INSTRUCTION

See Also:
  Constant Field Values

### FUNCTION_RESULT

    public static final int FUNCTION_RESULT

See Also:
  Constant Field Values

### ORDER_BY

    public static final int ORDER_BY

See Also:
  Constant Field Values

### TEMPLATE_RESULT

    public static final int TEMPLATE_RESULT

See Also:
  Constant Field Values

Constructor Detail

### RoleLocator

    public RoleLocator(int kind,
                       java.lang.Object container,
                       int operand,
                       NamePool namePool)

  Create information about the role of a subexpression within its parent expression

Parameters:
  `kind` - the kind of parent expression, e.g. a function call or a variable reference
  `container` - the name of the object in the parent expression, e.g. a function name or instruction name. May be expressed either as a String or as an Integer nameCode in the name pool.
  `operand` - Ordinal position of this subexpression, e.g. the position of an argument in
  `namePool` - The name pool. Must be supplied if the second argument is an Integer namecode. Otherwise, may be null.

Method Detail

### setErrorCode

    public void setErrorCode(java.lang.String code)

  Set the error code to be produced if a type error is detected

  Parameters:
    `code` - The error code

### getErrorCode

    public java.lang.String getErrorCode()

  Get the error code to be produced if a type error is detected

  Returns:
    code The error code

### setSourceLocator

    public void setSourceLocator(javax.xml.transform.SourceLocator locator)

  Set the source location

### getSourceLocator

    public javax.xml.transform.SourceLocator getSourceLocator()

  Get the source location (if known - return null if not known)

### getMessage

    public java.lang.String getMessage()

  Construct and return the error message indicating a type error

  Returns:
    the constructed error message

### composeErrorMessage

    public java.lang.String composeErrorMessage(ItemType requiredItemType,
                                                ItemType suppliedItemType,
                                                NamePool pool)

  Construct a full error message

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