Package net.sf.saxon.type

## Class AlphaCode

- java.lang.Object
- - net.sf.saxon.type.AlphaCode

-     public class AlphaCode
      extends java.lang.Object

  An AlphaCode is a compact, context-independent string representation of a SequenceType

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AlphaCode()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static java.lang.String` | `fromItemType​(ItemType type)` |
    `static java.lang.String` | `fromLexicalSequenceType​(XPathContext context, java.lang.String input)` |
    `static java.lang.String` | `fromSequenceType​(SequenceType type)` |
    `static java.lang.String` | `fromXdmMap​(MapItem map)` |
    `static ItemType` | `toItemType​(java.lang.String input, Configuration config)` | Convert an AlphaCode to an ItemType.
    `static SequenceType` | `toSequenceType​(java.lang.String input, Configuration config)` | Convert an AlphaCode to a SequenceType
    `static MapItem` | `toXdmMap​(java.lang.String input)` | Parse an AlphaCode into an XDM map

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AlphaCode

          public AlphaCode()

  - ### Method Detail

    - #### toXdmMap

          public static MapItem toXdmMap​(java.lang.String input)

      Parse an AlphaCode into an XDM map
      Parameters:
        `input` - the input alphacode
      Returns:
        the resulting map
      Throws:
        `java.lang.IllegalArgumentException` - if the input is not a valid AlphaCode

    - #### fromXdmMap

          public static java.lang.String fromXdmMap​(MapItem map)

    - #### toSequenceType

          public static SequenceType toSequenceType​(java.lang.String input,
                                                    Configuration config)

      Convert an AlphaCode to a SequenceType
      Parameters:
        `input` - the input alphacode
        `config` - the Saxon Configuration (which must contain any user-defined types that are referenced in the Alphacode)
      Returns:
        the corresponding SequenceType
      Throws:
        `java.lang.IllegalArgumentException` - if the input is not a valid AlphaCode

    - #### toItemType

          public static ItemType toItemType​(java.lang.String input,
                                            Configuration config)

      Convert an AlphaCode to an ItemType. The occurrence indicator of the alphacode may be omitted, or may be "1": any other value is treated as an error.
      Parameters:
        `input` - the input alphacode
        `config` - the Saxon Configuration (which must contain any user-defined types that are referenced in the Alphacode)
      Returns:
        the corresponding SequenceType
      Throws:
        `java.lang.IllegalArgumentException` - if the input is not a valid AlphaCode

    - #### fromItemType

          public static java.lang.String fromItemType​(ItemType type)

    - #### fromSequenceType

          public static java.lang.String fromSequenceType​(SequenceType type)

    - #### fromLexicalSequenceType

          public static java.lang.String fromLexicalSequenceType​(XPathContext context,
                                                                 java.lang.String input)
                                                          throws XPathException

      Throws:
        `XPathException`