|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.lib.ConversionRules
public class ConversionRules
This class defines a set of rules for converting between different atomic types. It handles the variations that arise between different versions of the W3C specifications, for example the changes in Name syntax between XML 1.0 and XML 1.1, the introduction of "+INF" as a permitted xs:double value in XSD 1.1, and so on.
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)
,
Serialized FormConstructor Summary | |
---|---|
ConversionRules()
|
Method Summary | |
---|---|
ConversionRules |
copy()
|
Converter |
getConverter(AtomicType source,
AtomicType target)
Get a Converter for a given pair of atomic types. |
NameChecker |
getNameChecker()
Get the class that will be used to check whether XML names are valid. |
StringConverter |
getStringConverter(AtomicType target)
Get a Converter that converts from strings to a given atomic type. |
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(String uri,
String local)
Ask whether a given notation is accepted by xs:NOTATION and its subclasses. |
boolean |
isValidURI(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 |
setNameChecker(NameChecker checker)
Set the class that will be used to check whether XML names are valid. |
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 |
setURIChecker(URIChecker checker)
Set the class to be used for checking URI values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConversionRules()
Method Detail |
---|
public ConversionRules copy()
public void setNameChecker(NameChecker checker)
checker
- the class to be used for checking names. There are variants of this
class depending on which version/edition of the XML specification is in use.public NameChecker getNameChecker()
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(String uri, String local)
uri
- the namespace URI of the notationlocal
- the local part of the name of the notation
public 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(CharSequence string)
string
- the string to be checked against the rules for URIs
public 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 type
public StringConverter getStringConverter(AtomicType target)
target
- the target type
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |