org.tockit.datatype.xsd
Class StringType
java.lang.Object
org.tockit.datatype.AbstractDatatype
org.tockit.datatype.xsd.AbstractXSDDatatype
org.tockit.datatype.xsd.StringType
- All Implemented Interfaces:
- Datatype, XMLizable
- Direct Known Subclasses:
- StringType.EnumerationRestrictedStringType, StringType.LengthRestrictedStringType, StringType.PatternRestrictedStringType
- public class StringType
- extends AbstractXSDDatatype
- To do:
- XSD allows combining the restrictions, we don't
Constructor Summary |
protected |
StringType(java.lang.String name)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringType
protected StringType(java.lang.String name)
getTypeCreator
public static DatatypeFactory.TypeCreator getTypeCreator()
createUnrestrictedType
public static StringType createUnrestrictedType(java.lang.String name)
createLengthRestrictedType
public static StringType createLengthRestrictedType(java.lang.String name,
int minLength,
int maxLength)
createPatternRestrictedType
public static StringType createPatternRestrictedType(java.lang.String name,
java.lang.String regExp)
createEnumerationRestrictedType
public static StringType createEnumerationRestrictedType(java.lang.String name,
StringValue[] enumeration)
createEnumerationRestrictedType
public static StringType createEnumerationRestrictedType(java.lang.String name,
java.lang.String[] enumeration)
isValidValue
public boolean isValidValue(Value valueToTest)
isValidStringValue
protected boolean isValidStringValue(java.lang.String valueToTest)
canConvertFrom
public boolean canConvertFrom(Value value)
- Specified by:
canConvertFrom
in interface Datatype
- Overrides:
canConvertFrom
in class AbstractDatatype
convertType
public Value convertType(Value value)
throws ConversionException
- Specified by:
convertType
in interface Datatype
- Overrides:
convertType
in class AbstractDatatype
- Throws:
ConversionException
canParse
public boolean canParse(java.lang.String text)
- Specified by:
canParse
in interface Datatype
- Overrides:
canParse
in class AbstractDatatype
parse
public Value parse(java.lang.String text)
throws ConversionException
- Specified by:
parse
in interface Datatype
- Overrides:
parse
in class AbstractDatatype
- Throws:
ConversionException
toValue
public Value toValue(org.jdom.Element element)
insertValue
public void insertValue(org.jdom.Element element,
Value value)
- Description copied from interface:
Datatype
- Adds the given value into the element.
This can be done either by adding a "value" attribute or by adding content.
Both are in the default namespace, but which way is used depends on the actual
type implementation.
readXML
public void readXML(org.jdom.Element elem)
throws XMLSyntaxError
- Description copied from interface:
XMLizable
- Read this element as the content of elem.
- Throws:
XMLSyntaxError
addRestrictions
protected void addRestrictions(org.jdom.Element restrictionElement)
- Specified by:
addRestrictions
in class AbstractXSDDatatype
getBaseType
protected java.lang.String getBaseType()
- Specified by:
getBaseType
in class AbstractXSDDatatype
The ToscanaJ project