org.exolab.castor.builder.types

Class XSString

public final class XSString extends XSPatternBase

The XML Schema String type

Version: $Revision: 1.5 $ $Date: 2005/03/05 13:41:44 $

Author: Keith Visco

Constructor Summary
XSString()
Creates a new XSString
Method Summary
StringcreateFromJavaObjectCode(String variableName)
Returns the String necessary to convert an Object to an instance of this XSType.
JTypegetJType()
Returns the JType that this XSType represents
intgetLength()
Returns the length that this type must have
intgetMaxLength()
Returns the maximum length occurances of this type can be.
intgetMinLength()
Returns the minimum length occurances of this type can be.
StringgetWhiteSpace()
Returns the whiteSpace facet of this type
booleanhasLength()
Returns true if a length has been set
booleanhasMaxLength()
Returns true if a maximum length has been set
booleanhasMinLength()
Returns true if a minimum length has been set
booleanhasWhiteSpace()
Returns true if the whiteSpace facet is used
voidsetFacets(SimpleType simpleType)
voidsetLength(int length)
Sets the length of this XSString.
voidsetMaxLength(int maxLength)
Sets the maximum length of this XSString.
voidsetMinLength(int minLength)
Sets the minimum length of this XSString.
voidsetWhiteSpace(String value)

Sets the whiteSpace facet of this XSString.

voidvalidationCode(JSourceCode jsc, String fixedValue, String fieldValidatorInstanceName)
Creates the validation code for an instance of this XSType.

Constructor Detail

XSString

public XSString()
Creates a new XSString

Method Detail

createFromJavaObjectCode

public String createFromJavaObjectCode(String variableName)
Returns the String necessary to convert an Object to an instance of this XSType. This method is really only useful for primitive types

Parameters: variableName the name of the Object

Returns: the String necessary to convert an Object to an instance of this XSType

getJType

public JType getJType()
Returns the JType that this XSType represents

Returns: the JType that this XSType represents

getLength

public int getLength()
Returns the length that this type must have

Returns: the length that this type must have

getMaxLength

public int getMaxLength()
Returns the maximum length occurances of this type can be. A negative value denotes no maximum length

Returns: the maximum length facet

getMinLength

public int getMinLength()
Returns the minimum length occurances of this type can be.

Returns: the minimum length facet

getWhiteSpace

public String getWhiteSpace()
Returns the whiteSpace facet of this type

Returns: the whiteSpace facet of this type

hasLength

public boolean hasLength()
Returns true if a length has been set

Returns: true if a length has been set

hasMaxLength

public boolean hasMaxLength()
Returns true if a maximum length has been set

Returns: true if a maximum length has been set

hasMinLength

public boolean hasMinLength()
Returns true if a minimum length has been set

Returns: true if a minimum length has been set

hasWhiteSpace

public boolean hasWhiteSpace()
Returns true if the whiteSpace facet is used

UNKNOWN: true if the whiteSpace facet is used

setFacets

public void setFacets(SimpleType simpleType)

setLength

public void setLength(int length)
Sets the length of this XSString. While setting the length, the maxLength and minLength are also set up to this length

Parameters: length the length to set

See Also: XSString XSString

setMaxLength

public void setMaxLength(int maxLength)
Sets the maximum length of this XSString. To remove the max length facet, use a negative value.

Parameters: maxLength the maximum length for occurances of this type

setMinLength

public void setMinLength(int minLength)
Sets the minimum length of this XSString.

Parameters: minLength the minimum length for occurances of this type

setWhiteSpace

public void setWhiteSpace(String value)

Sets the whiteSpace facet of this XSString.

The value of the whiteSpace facet must be one of the following:

any other value will generate a Warning and set the whiteSpace to preserved

Parameters: value the whiteSpace value

validationCode

public void validationCode(JSourceCode jsc, String fixedValue, String fieldValidatorInstanceName)
Creates the validation code for an instance of this XSType. The validation code should if necessary create a newly configured TypeValidator, that should then be added to a FieldValidator instance whose name is provided.

Parameters: fixedValue a fixed value to use if any jsc the JSourceCode to fill in. fieldValidatorInstanceName the name of the FieldValidator that the configured TypeValidator should be added to.

Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com