org.relaxng.datatype
Interface DatatypeBuilder
- All Known Implementing Classes:
- ParameterlessDatatypeBuilder
- public interface DatatypeBuilder
creates an user-defined type by adding parameters to the pre-defined type.
- Author:
- Kohsuke KAWAGUCHI
Method Summary |
void |
addParameter(java.lang.String name,
java.lang.String strValue,
ValidationContext context)
adds a new parameter. |
Datatype |
createDatatype()
derives a new Datatype from a Datatype by parameters that were already set
through the addParameter method. |
addParameter
public void addParameter(java.lang.String name,
java.lang.String strValue,
ValidationContext context)
throws DatatypeException
- adds a new parameter.
- Parameters:
name
- the name of the parameter to be added.strValue
- the raw value of the parameter. Caller may not normalize this value
becuase any white space is potentially significant.context
- The context information which can be used by the callee to
acquire additional information. This context object is valid only
during this method call. The callee may not keep the reference
to this object.- Throws:
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.
createDatatype
public Datatype createDatatype()
throws DatatypeException
- derives a new Datatype from a Datatype by parameters that were already set
through the addParameter method.
- Throws:
DatatypeException
- DatatypeException must be thrown if the derivation is somehow invalid.
For example, required parameter is missing, etc. The exception should
contain a diagnosis message if possible.