Package org.exolab.castor.builder.types
Class XSListType
- java.lang.Object
-
- org.exolab.castor.builder.types.XSType
-
- org.exolab.castor.builder.types.XSListType
-
- Direct Known Subclasses:
XSIdRefs,XSList,XSNMTokens
public abstract class XSListType extends XSType
A base class for all list types.- Version:
- $Revision: 6678 $ $Date: 2005-12-13 14:58:48 -0700 (Tue, 13 Dec 2005) $
- Author:
- Ralf Joachim
-
-
Field Summary
-
Fields inherited from class org.exolab.castor.builder.types.XSType
ANYURI_TYPE, BASE64BINARY_TYPE, BOOLEAN_TYPE, BYTE_TYPE, CLASS, COLLECTION, DATE_TYPE, DATETIME_TYPE, DECIMAL_TYPE, DOUBLE_TYPE, DURATION_TYPE, ENTITIES, ENTITY, FLOAT_TYPE, GDAY_TYPE, GMONTH_TYPE, GMONTHDAY_TYPE, GYEAR_TYPE, GYEARMONTH_TYPE, HEXBINARY_TYPE, ID_TYPE, IDREF_TYPE, IDREFS_TYPE, INT_TYPE, INTEGER_TYPE, LANGUAGE_TYPE, LONG_TYPE, NAME_TYPE, NCNAME_TYPE, NEGATIVE_INTEGER_TYPE, NMTOKEN_TYPE, NMTOKENS_TYPE, NON_NEGATIVE_INTEGER_TYPE, NON_POSITIVE_INTEGER_TYPE, NORMALIZEDSTRING_TYPE, NOTATION_TYPE, NULL, POSITIVE_INTEGER_TYPE, QNAME_TYPE, SHORT_TYPE, STRING_TYPE, TIME_TYPE, TOKEN_TYPE, UNSIGNED_BYTE_TYPE, UNSIGNED_INT_TYPE, UNSIGNED_LONG_TYPE, UNSIGNED_SHORT_TYPE
-
-
Constructor Summary
Constructors Constructor Description XSListType(java.lang.String colType, XSType contentType, boolean useJava50)Creates an instance of this (abstract base) collection type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringcreateFromJavaObjectCode(java.lang.String variableName)Returns the string necessary to convert an Object to an instance of this XSType.java.lang.StringcreateToJavaObjectCode(java.lang.String variableName)Returns the string necessary to convert an instance of this XSType to an Object.XSTypegetContentType()Returns the type contained in the list.JTypegetJType()Returns the JType that this XSType represents.intgetMaximumSize()Returns the maximum allowed size for this list.intgetMinimumSize()Returns the minimum allowed size for this list.java.lang.StringgetName()Returns the name of this XSType.booleanisCollection()Returns true if this XSType represents a collection.booleanisDateTime()Returns true if the XSType represents an XML Schema date/time type.booleanisPrimitive()Returns true if this XSType represents a primitive type.java.lang.StringnewInstanceCode()Returns the Java code neccessary to create a new instance of the JType associated with this XSType.protected voidsetFacet(Facet facet)Set the given facet for XSType if applicable.voidsetMaximumSize(int size)Sets the maximum allowed size for this list.voidsetMinimumSize(int size)Sets the minimum allowed size for this list.-
Methods inherited from class org.exolab.castor.builder.types.XSType
createDefaultValueWithString, getType, isEnumerated, setAsEnumerated, setFacets, validationCode
-
-
-
-
Constructor Detail
-
XSListType
public XSListType(java.lang.String colType, XSType contentType, boolean useJava50)Creates an instance of this (abstract base) collection type.- Parameters:
colType- Type of collection to use.contentType- Type of the collection members.useJava50- If true, the collection will be generated using Java 5
-
-
Method Detail
-
getContentType
public final XSType getContentType()
Returns the type contained in the list.- Returns:
- The type contained in the list.
-
getJType
public JType getJType()
Returns the JType that this XSType represents.
-
getMaximumSize
public final int getMaximumSize()
Returns the maximum allowed size for this list.- Returns:
- The maximum allowed size for this list.
-
setMaximumSize
public final void setMaximumSize(int size)
Sets the maximum allowed size for this list.- Parameters:
size- New maximum size for this list
-
getMinimumSize
public final int getMinimumSize()
Returns the minimum allowed size for this list.- Returns:
- The minimum allowed size for this list.
-
setMinimumSize
public final void setMinimumSize(int size)
Sets the minimum allowed size for this list.- Parameters:
size- New minimum size for this list
-
isCollection
public boolean isCollection()
Returns true if this XSType represents a collection.- Overrides:
isCollectionin classXSType- Returns:
- True if this XSType represents a collection.
-
getName
public java.lang.String getName()
Returns the name of this XSType.
-
isPrimitive
public boolean isPrimitive()
Returns true if this XSType represents a primitive type.- Specified by:
isPrimitivein classXSType- Returns:
- True if this XSType represents a primitive type.
-
isDateTime
public boolean isDateTime()
Returns true if the XSType represents an XML Schema date/time type.- Specified by:
isDateTimein classXSType- Returns:
- True if the XSType represents an XML Schema date/time type.
-
newInstanceCode
public java.lang.String newInstanceCode()
Returns the Java code neccessary to create a new instance of the JType associated with this XSType.- Specified by:
newInstanceCodein classXSType- Returns:
- The Java code neccessary to create a new instance.
-
createToJavaObjectCode
public java.lang.String createToJavaObjectCode(java.lang.String variableName)
Returns the string necessary to convert an instance of this XSType to an Object. This method is really only useful for primitive types.- Specified by:
createToJavaObjectCodein classXSType- Parameters:
variableName- The name of the instance variable.- Returns:
- The String necessary to convert an instance of this XSType to an Object.
-
createFromJavaObjectCode
public java.lang.String createFromJavaObjectCode(java.lang.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.- Specified by:
createFromJavaObjectCodein classXSType- Parameters:
variableName- The name of the Object.- Returns:
- The String necessary to convert an Object to an instance of this XSType.
-
-