## net.sf.saxon.trans
Class KeyDefinition

    java.lang.Object
      net.sf.saxon.instruct.Procedure
          net.sf.saxon.trans.KeyDefinition

All Implemented Interfaces:
  Container, InstructionInfoProvider, LocationProvider, java.io.Serializable, javax.xml.transform.SourceLocator

public class KeyDefinition
extends Procedure
implements java.io.Serializable, InstructionInfoProvider

Corresponds to a single xsl:key declaration.

See Also:
  Serialized Form

Constructor Summary
`KeyDefinition(Pattern match, Expression use, java.lang.String collationName, java.text.Collator collation)` Constructor to create a key definition

Method Summary
`java.text.Collator` `getCollation()` Get the collation.
`java.lang.String` `getCollationName()` Get the collation name for this key definition.
`InstructionInfo` `getInstructionInfo()` Get the InstructionInfo details about the construct.
`Pattern` `getMatch()` Get the match pattern for the key definition
`Expression` `getUse()` Get the use expression for the key definition
`boolean` `isBackwardsCompatible()` Test backwards compatibility mode
`void` `setBackwardsCompatible(boolean bc)` Set backwards compatibility mode.
`void` `setLocation(java.lang.String systemId, int lineNumber)` Set the system Id and line number of the source xsl:key definition
`void` `setStackFrameMap(SlotManager map)` Set the map of local variables needed while evaluating the "use" expression

Methods inherited from class net.sf.saxon.instruct.Procedure
`getBody, getColumnNumber, getExecutable, getLineNumber, getLineNumber, getLocationProvider, getPublicId, getStackFrameMap, getSystemId, getSystemId, setBody, setExecutable, setLineNumber, setSystemId`

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

Constructor Detail

### KeyDefinition

    public KeyDefinition(Pattern match,
                         Expression use,
                         java.lang.String collationName,
                         java.text.Collator collation)

  Constructor to create a key definition

Method Detail

### setBackwardsCompatible

    public void setBackwardsCompatible(boolean bc)

  Set backwards compatibility mode. The key definition is backwards compatible if ANY of the xsl:key declarations has version="1.0" in scope.

### isBackwardsCompatible

    public boolean isBackwardsCompatible()

  Test backwards compatibility mode

### setStackFrameMap

    public void setStackFrameMap(SlotManager map)

  Set the map of local variables needed while evaluating the "use" expression

  Overrides:
    `setStackFrameMap` in class `Procedure`

### setLocation

    public void setLocation(java.lang.String systemId,
                            int lineNumber)

  Set the system Id and line number of the source xsl:key definition

### getMatch

    public Pattern getMatch()

  Get the match pattern for the key definition

  Returns:
    the pattern specified in the "match" attribute of the xsl:key declaration

### getUse

    public Expression getUse()

  Get the use expression for the key definition

  Returns:
    the expression specified in the "use" attribute of the xsl:key declaration

### getCollationName

    public java.lang.String getCollationName()

  Get the collation name for this key definition.

  Returns:
    the collation name (the collation URI)

### getCollation

    public java.text.Collator getCollation()

  Get the collation.

  Returns:
    the collation

### getInstructionInfo

    public InstructionInfo getInstructionInfo()

  Get the InstructionInfo details about the construct. This information isn't used for tracing, but it is available when inspecting the context stack.

  Specified by:
    `getInstructionInfo` in interface `InstructionInfoProvider`