org.relaxng.datatype.helpers
Class ParameterlessDatatypeBuilder

java.lang.Object
  |
  +--org.relaxng.datatype.helpers.ParameterlessDatatypeBuilder
All Implemented Interfaces:
DatatypeBuilder

public final class ParameterlessDatatypeBuilder
extends java.lang.Object
implements DatatypeBuilder

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 {
     ....
     ....
 }
 

Author:
Kohsuke KAWAGUCHI

Constructor Summary
ParameterlessDatatypeBuilder(Datatype baseType)
           
 
Method Summary
 void add(java.lang.String name, java.lang.String strValue, ValidationContext context)
          adds a new parameter.
 Datatype derive()
          derives a new Datatype from a Datatype by parameters that were already set.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterlessDatatypeBuilder

public ParameterlessDatatypeBuilder(Datatype baseType)
Method Detail

add

public void add(java.lang.String name,
                java.lang.String strValue,
                ValidationContext context)
         throws DatatypeException
Description copied from interface: DatatypeBuilder
adds a new parameter.
Specified by:
add in interface DatatypeBuilder
Following copied from interface: org.relaxng.datatype.DatatypeBuilder
Parameters:
name - the name of the parameter to be added.
strValue - the raw value of the parameter. Caller may not normalize this value.
context - The context information which can be used by the implementation to acquire additional information. This context object is valid only during this method call. The implementations may not keep the reference to this object.
Throws:
DatatypeException - when the given parameter is inappropriate for some reason. The implementation is responsible to recover from this error. That is, the object should behave as if no such error was occured.

derive

public Datatype derive()
                throws DatatypeException
Description copied from interface: DatatypeBuilder
derives a new Datatype from a Datatype by parameters that were already set.
Specified by:
derive in interface DatatypeBuilder
Following copied from interface: org.relaxng.datatype.DatatypeBuilder
Throws:
DatatypeException - DatatypeException is thrown if the derivation is somehow invalid. For example, required parameter is missing, etc.