public class ConversionRules
extends java.lang.Object
It is possible to nominate a customized ConversionRules
object at the level of the
Configuration
, either by instantiating this class and changing the properties, or
by subclassing.
Configuration.setConversionRules(ConversionRules)
Modifier and Type | Field and Description |
---|---|
static ConversionRules |
DEFAULT |
Constructor and Description |
---|
ConversionRules() |
Modifier and Type | Method and Description |
---|---|
ConversionRules |
copy()
Create a copy of these conversion rules.
|
void |
copyTo(ConversionRules cr)
Create a copy of these conversion rules.
|
Converter |
getConverter(AtomicType source,
AtomicType target)
Get a Converter for a given pair of atomic types.
|
StringToDouble |
getStringToDoubleConverter()
Get the converter that will be used for converting strings to doubles and floats.
|
boolean |
isAllowYearZero()
Ask whether year zero is permitted in dates.
|
boolean |
isDeclaredNotation(java.lang.String uri,
java.lang.String local)
Ask whether a given notation is accepted by xs:NOTATION and its subclasses.
|
boolean |
isValidURI(java.lang.CharSequence string)
Ask whether a string is a valid instance of xs:anyURI according to the rules
defined by the current URIChecker
|
void |
setAllowYearZero(boolean allowed)
Say whether year zero is permitted in dates.
|
void |
setNotationSet(NotationSet notations)
Specify the set of notations that are accepted by xs:NOTATION and its subclasses.
|
void |
setStringToDoubleConverter(StringToDouble converter)
Set the converter that will be used for converting strings to doubles and floats.
|
void |
setTypeHierarchy(TypeHierarchy typeHierarchy) |
void |
setURIChecker(URIChecker checker)
Set the class to be used for checking URI values.
|
public static final ConversionRules DEFAULT
public ConversionRules copy()
public void copyTo(ConversionRules cr)
cr
- a ConversionRules object which will be updated to hold a copy of the rules.
The cache of converters is NOT copied (because changes to the conversion rules would
invalidate the cache)public void setTypeHierarchy(TypeHierarchy typeHierarchy)
public void setStringToDoubleConverter(StringToDouble converter)
converter
- the converter to be used. There are two converters in regular use:
they differ only in whether the lexical value "+INF" is recognized as a representation of
positive infinity.public StringToDouble getStringToDoubleConverter()
public void setNotationSet(NotationSet notations)
notations
- the set of notations that are recognized; or null, to indicate that all notation
names are acceptedpublic boolean isDeclaredNotation(java.lang.String uri, java.lang.String local)
uri
- the namespace URI of the notationlocal
- the local part of the name of the notationpublic void setURIChecker(URIChecker checker)
checker
- an object to be used for checking URIs; or null if any string is accepted as an anyURI valuepublic boolean isValidURI(java.lang.CharSequence string)
string
- the string to be checked against the rules for URIspublic void setAllowYearZero(boolean allowed)
allowed
- true if year zero is permittedpublic boolean isAllowYearZero()
public Converter getConverter(AtomicType source, AtomicType target)
source
- the source typetarget
- the target typeCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.