Prime Datatype Library

package com.elharo.xml.relaxng;

import org.relaxng.datatype.*;
import org.relaxng.datatype.helpers.*;

public class PrimeDatatypeLibrary implements DatatypeLibrary {

    public Datatype createDatatype(String typeLocalName)
      throws DatatypeException {
        
        if ("prime".equals(typeLocalName)) {
            return new PrimeDatatype();
        }
        throw new DatatypeException("Unsupported type: " + typeLocalName);
        
    }

    public DatatypeBuilder createDatatypeBuilder(String baseTypeLocalName) 
      throws DatatypeException {
        
        return new ParameterlessDatatypeBuilder(
          createDatatype("prime")
        );
        
    }

}

Previous | Next | Top | Cafe con Leche

Copyright 2005-2007 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified October 26, 2004