Package relaxngcc.datatype

# Class Datatype

java.lang.Object
relaxngcc.datatype.Datatype

public final class Datatype extends Object
Represents a RELAX NG datatype and its parsing code generator.

Author:
  Kohsuke Kawaguchi (kk@kohsuke.org)

## Field Summary

Fields
Modifier and Type
Field
Description
`static final Datatype`
`NOOP`
Datatype instance that doesn't do any conversion.

## Method Summary

Modifier and Type
Method
Description
`String`
`displayName()`
Gets the display name of this datatype.
`CDExpression`
`generate(NGCCGrammar grammar, CDVariable $text)`
Generates the expression that parses the specified string into a target language value type.
`CDType`
`getType()`
Returns the type to which the return value from the generate method evaluates to.

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

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

## Field Details

### NOOP

public static final Datatype NOOP
Datatype instance that doesn't do any conversion. This is the default logic.

## Method Details

### generate

public CDExpression generate(NGCCGrammar grammar, CDVariable $text) throws NoDefinitionException, IOException
Generates the expression that parses the specified string into a target language value type.

Parameters:
  `grammar` - This datatype is used for this grammar.
Throws:
  `NoDefinitionException`
  `IOException`

### getType

public CDType getType()
Returns the type to which the return value from the generate method evaluates to.

### displayName

public String displayName()
Gets the display name of this datatype. Usually this is the datatype name, but not always.

Returns:
  a non-null valid string.