Top Description Fields Constructors Methods
com.sun.tools.rngdatatype.helpers

public final Class ParameterlessDatatypeBuilder

extends Object
implements DatatypeBuilder
Class Inheritance
All Implemented Interfaces
com.sun.tools.rngdatatype.DatatypeBuilder
Imports
com.sun.tools.rngdatatype.Datatype, .DatatypeBuilder, .DatatypeException, .ValidationContext

Dummy implementation of DatatypeBuilder. This implementation can be used for Datatypes which have no parameters. Any attempt to add parameters will be rejected.

Typical usage would be:

class MyDatatypeLibrary implements DatatypeLibrary {
    ....
    DatatypeBuilder createDatatypeBuilder( String typeName ) {
        return new ParameterleessDatatypeBuilder(createDatatype(typeName));
    }
    ....
}
Author
Kohsuke KAWAGUCHI

Field Summary

Modifier and TypeField and Description
private final Datatype
baseType

This type object is returned for the derive method.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public Datatype
createDatatype()

Implements com.sun.tools.rngdatatype.DatatypeBuilder.createDatatype.

Derives a new Datatype from a Datatype by parameters that were already set through the addParameter method.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

baseTypeback to summary
private final Datatype baseType

This type object is returned for the derive method.

Constructor Detail

ParameterlessDatatypeBuilderback to summary
public ParameterlessDatatypeBuilder(Datatype baseType)

Method Detail

addParameterback to summary
public void addParameter(String name, String strValue, ValidationContext context) throws DatatypeException

Implements com.sun.tools.rngdatatype.DatatypeBuilder.addParameter.

Doc from com.sun.tools.rngdatatype.DatatypeBuilder.addParameter.

Adds a new parameter.

Exceptions
DatatypeException:
When the given parameter is inappropriate for some reason. The callee is responsible to recover from this error. That is, the object should behave as if no such error was occured.
createDatatypeback to summary
public Datatype createDatatype() throws DatatypeException

Implements com.sun.tools.rngdatatype.DatatypeBuilder.createDatatype.

Doc from com.sun.tools.rngdatatype.DatatypeBuilder.createDatatype.

Derives a new Datatype from a Datatype by parameters that were already set through the addParameter method.

Exceptions
DatatypeException:
DatatypeException must be thrown if the derivation is somehow invalid. For example, a required parameter is missing, etc. The exception should contain a diagnosis message if possible.