com.sun.msv.datatype.xsd

Class TypeIncubator


public class TypeIncubator
extends Object

derives a new type by adding facets.
Author:
Kohsuke KAWAGUCHI

Constructor Summary

TypeIncubator(XSDatatype baseType)

Method Summary

void
add(String name, String strValue, boolean fixed, ValidationContext context)
Deprecated. please use the addFacet method, which is better named.
void
addFacet(String name, String strValue, boolean fixed, ValidationContext context)
adds a facet to the type.
XSDatatypeImpl
derive(String newName)
Deprecated.
XSDatatypeImpl
derive(String newNameUri, String newLocalName)
derives a new datatype from a datatype by facets that were set.
void
dump(PrintStream out)
dumps the contents to the given object.
Object
getFacet(String facetName)
gets a value of non-repeatable facet the behavior is undefined when the specified facetName doesn't exist in this map.
String
getFacetNames()
gets names of the facets in this object this method is used to produce error messages.
int
getNonNegativeInteger(String facetName)
gets a value of non-repeatable facet as a non-negative integer the behavior is undefined when the specified facetName doesn't exist in this map.
int
getPositiveInteger(String facetName)
gets a value of non-repeatable facet as a positive integer the behavior is undefined when the specified facetName doesn't exist in this map.
Vector
getVector(String facetName)
gets a value of repeatable facet the behavior is undefined when the specified facetName doesn't exist in this map.
boolean
isEmpty()
returns true if no facet is added
boolean
isFixed(String facetName)
returns true if that facet is fixed.

Constructor Details

TypeIncubator

public TypeIncubator(XSDatatype baseType)

Method Details

add

public void add(String name,
                String strValue,
                boolean fixed,
                ValidationContext context)
            throws DatatypeException

Deprecated. please use the addFacet method, which is better named.

adds a facet to the type.

addFacet

public void addFacet(String name,
                     String strValue,
                     boolean fixed,
                     ValidationContext context)
            throws DatatypeException
adds a facet to the type.

derive

public XSDatatypeImpl derive(String newName)
            throws DatatypeException

Deprecated.


derive

public XSDatatypeImpl derive(String newNameUri,
                             String newLocalName)
            throws DatatypeException
derives a new datatype from a datatype by facets that were set. It is completely legal to use null as the newTypeName parameter, which means the derivation of an anonymous datatype.

dump

public void dump(PrintStream out)
dumps the contents to the given object. this method is for debug use only.

getFacet

public Object getFacet(String facetName)
gets a value of non-repeatable facet the behavior is undefined when the specified facetName doesn't exist in this map.

getFacetNames

public String getFacetNames()
gets names of the facets in this object this method is used to produce error messages.

getNonNegativeInteger

public int getNonNegativeInteger(String facetName)
            throws DatatypeException
gets a value of non-repeatable facet as a non-negative integer the behavior is undefined when the specified facetName doesn't exist in this map.

getPositiveInteger

public int getPositiveInteger(String facetName)
            throws DatatypeException
gets a value of non-repeatable facet as a positive integer the behavior is undefined when the specified facetName doesn't exist in this map.

getVector

public Vector getVector(String facetName)
gets a value of repeatable facet the behavior is undefined when the specified facetName doesn't exist in this map.

isEmpty

public boolean isEmpty()
returns true if no facet is added

isFixed

public boolean isFixed(String facetName)
returns true if that facet is fixed. the behavior is undefined when the specified facetName doesn't exist in this map.