Top Description Inners Fields Constructors Methods
com.sun.msv.datatype.xsd

public Class TypeIncubator

extends Object
Class Inheritance
Imports
org.relaxng.datatype.DatatypeException, .ValidationContext, java.math.BigInteger, java.util.Iterator, .Map, .Vector

derives a new type by adding facets.
Author
Kohsuke KAWAGUCHI

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final XSDatatypeImpl
baseType

base type

private static final String[][]
private final Map<K, V>
impl

storage for non-repeatable facets

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(String name, String strValue, boolean fixed, ValidationContext context)

Deprecated please use the addFacet method, which is better named.
adds a facet to the type.
public void
addFacet(String name, String strValue, boolean fixed, ValidationContext context)

adds a facet to the type.

private static void
checkRangeConsistency(XSDatatypeImpl newType, String facetName1, String facetName2)

check (min,max) facet specification and makes sure that they are consistent

private boolean
contains(String facetName)

checks if the specified facet was added to this map

public XSDatatypeImpl
derive(String newName)

Deprecated
public XSDatatypeImpl
derive(String newNameUri, String newLocalName)

derives a new datatype from a datatype by facets that were set.

public void
dump(PrintStream out)

dumps the contents to the given object.

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.

public String
getFacetNames()

gets names of the facets in this object this method is used to produce error messages.

public 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.

public 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.

public Vector<E>
getVector(String facetName)

gets a value of repeatable facet the behavior is undefined when the specified facetName doesn't exist in this map.

public boolean
isEmpty()

returns true if no facet is added

public boolean
isFixed(String facetName)

returns true if that facet is fixed.

private static boolean
isRepeatable(String facetName)

returns true if the specified facet is a facet which can be set multiple times.

private static boolean
isValueFacet(String facetName)

returns true if the specified facet is a facet that needs value-space-level check.

private static DatatypeException
reportFacetInconsistency(String newName, DataTypeWithFacet o1, String facetName1, DataTypeWithFacet o2, String facetName2)

creates a BadTypeException with appropriate error message.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

baseTypeback to summary
private final XSDatatypeImpl baseType

base type

exclusiveFacetPairsback to summary
private static final String[][] exclusiveFacetPairs
implback to summary
private final Map<K, V> impl

storage for non-repeatable facets

Constructor Detail

TypeIncubatorback to summary
public TypeIncubator(XSDatatype baseType)

Method Detail

addback to summary
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.

addFacetback to summary
public void addFacet(String name, String strValue, boolean fixed, ValidationContext context) throws DatatypeException

adds a facet to the type.

Exceptions
DatatypeException:
when given facet is already specified
checkRangeConsistencyback to summary
private static void checkRangeConsistency(XSDatatypeImpl newType, String facetName1, String facetName2) throws DatatypeException

check (min,max) facet specification and makes sure that they are consistent

Exceptions
DatatypeException:
when two facets are inconsistent
containsback to summary
private boolean contains(String facetName)

checks if the specified facet was added to this map

deriveback to summary
public XSDatatypeImpl derive(String newName) throws DatatypeException

Deprecated

deriveback to summary
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.

Exceptions
DatatypeException:
DatatypeException is thrown if derivation is somehow invalid. For example, not applicable facets are applied, or enumeration has invalid values, ... things like that.
dumpback to summary
public void dump(PrintStream out)

dumps the contents to the given object. this method is for debug use only.

getFacetback to summary
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.

getFacetNamesback to summary
public String getFacetNames()

gets names of the facets in this object this method is used to produce error messages.

getNonNegativeIntegerback to summary
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.

Exceptions
DatatypeException:
if the parameter cannot be parsed as a non-negative integer
getPositiveIntegerback to summary
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.

Exceptions
DatatypeException:
if the parameter cannot be parsed as a positive integer
getVectorback to summary
public Vector<E> getVector(String facetName)

gets a value of repeatable facet the behavior is undefined when the specified facetName doesn't exist in this map.

isEmptyback to summary
public boolean isEmpty()

returns true if no facet is added

isFixedback to summary
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.

isRepeatableback to summary
private static boolean isRepeatable(String facetName)

returns true if the specified facet is a facet which can be set multiple times.

isValueFacetback to summary
private static boolean isValueFacet(String facetName)

returns true if the specified facet is a facet that needs value-space-level check.

reportFacetInconsistencyback to summary
private static DatatypeException reportFacetInconsistency(String newName, DataTypeWithFacet o1, String facetName1, DataTypeWithFacet o2, String facetName2)

creates a BadTypeException with appropriate error message. this method is only useful for reporting facet consistency violation.

com.sun.msv.datatype.xsd back to summary

private Class TypeIncubator.FacetInfo

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
public boolean
public Object

Constructor Summary

AccessConstructor and Description
public
FacetInfo(Object value, boolean fixed)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fixedback to summary
public boolean fixed
valueback to summary
public Object value

Constructor Detail

FacetInfoback to summary
public FacetInfo(Object value, boolean fixed)