org.exolab.castor.builder.types
Class XSPositiveInteger

java.lang.Object
  extended by org.exolab.castor.builder.types.XSType
      extended by org.exolab.castor.builder.types.AbstractPatternFacet
          extended by org.exolab.castor.builder.types.AbstractWhiteSpaceFacet
              extended by org.exolab.castor.builder.types.AbstractRangeFacet
                  extended by org.exolab.castor.builder.types.AbstractDigitsFacet
                      extended by org.exolab.castor.builder.types.XSPositiveInteger

public final class XSPositiveInteger
extends AbstractDigitsFacet

The xsd:positiveInteger XML Schema type.

Version:
$Revision: 7277 $ $Date: 2005-03-05 06:42:06 -0700 (Sat, 05 Mar 2005) $
Author:
Keith Visco, Ralf Joachim

Field Summary
static java.lang.String MIN_VALUE
          A constant holding the minimum value an xsd:positiveInteger can have, 1.
static java.lang.String NAME
          Name of this XSType.
static short TYPE
          Type number of this XSType.
 
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
XSPositiveInteger()
          No-arg constructor.
XSPositiveInteger(boolean asWrapper)
          Constructs a new XSPositiveInteger.
 
Method Summary
 java.lang.String createDefaultValueWithString(java.lang.String variableName)
          Creates source code for an additional constructor that deals with default values as specified in the XML schema instance.
 java.lang.String createFromJavaObjectCode(java.lang.String variableName)
          Returns the string necessary to convert an Object to an instance of this XSType.
 java.lang.String createToJavaObjectCode(java.lang.String variableName)
          Returns the string necessary to convert an instance of this XSType to an Object.
 JType getJType()
          Returns the JType that this XSType represents.
 java.lang.String getName()
          Returns the name of this XSType.
 short getType()
          Returns the type of this XSType.
 boolean isDateTime()
          Returns true if the XSType represents an XML Schema date/time type.
 boolean isPrimitive()
          Returns true if this XSType represents a primitive type.
 java.lang.String newInstanceCode()
          Returns the Java code neccessary to create a new instance of the JType associated with this XSType.
 void validationCode(JSourceCode jsc, java.lang.String fixedValue, java.lang.String validatorInstanceName)
          Creates the validation code for an instance of this XSType.
 
Methods inherited from class org.exolab.castor.builder.types.AbstractDigitsFacet
codeDigitsFacet, getFractionDigits, getTotalDigits, setDigitsFacet, setFacet, setFractionDigits, setTotalDigits
 
Methods inherited from class org.exolab.castor.builder.types.AbstractRangeFacet
codeRangeFacet, getMaxExclusive, getMaxInclusive, getMinExclusive, getMinInclusive, hasMaximum, hasMinimum, setMaxExclusive, setMaxInclusive, setMinExclusive, setMinInclusive, setRangeFacet
 
Methods inherited from class org.exolab.castor.builder.types.AbstractWhiteSpaceFacet
codeWhiteSpaceFacet, getWhiteSpace, hasWhiteSpace, setWhiteSpace, setWhiteSpaceFacet
 
Methods inherited from class org.exolab.castor.builder.types.AbstractPatternFacet
addPattern, addPatternFacet, codePatternFacet, getPatterns
 
Methods inherited from class org.exolab.castor.builder.types.XSType
isCollection, isEnumerated, setAsEnumerated, setFacets
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
Name of this XSType.

See Also:
Constant Field Values

TYPE

public static final short TYPE
Type number of this XSType.

See Also:
Constant Field Values

MIN_VALUE

public static final java.lang.String MIN_VALUE
A constant holding the minimum value an xsd:positiveInteger can have, 1.

See Also:
Constant Field Values
Constructor Detail

XSPositiveInteger

public XSPositiveInteger()
No-arg constructor.


XSPositiveInteger

public XSPositiveInteger(boolean asWrapper)
Constructs a new XSPositiveInteger.

Parameters:
asWrapper - If true, use the java.lang wrapper class.
Method Detail

getName

public java.lang.String getName()
Returns the name of this XSType.

Specified by:
getName in class XSType
Returns:
The name of this XSType.

getType

public short getType()
Returns the type of this XSType.

Specified by:
getType in class XSType
Returns:
the type of this XSType.

isPrimitive

public boolean isPrimitive()
Returns true if this XSType represents a primitive type.

Specified by:
isPrimitive in class XSType
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:
isDateTime in class XSType
Returns:
True if the XSType represents an XML Schema date/time type.

getJType

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

Specified by:
getJType in class XSType
Returns:
The JType that this XSType represents.

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:
newInstanceCode in class XSType
Returns:
The Java code neccessary to create a new instance.

createDefaultValueWithString

public java.lang.String createDefaultValueWithString(java.lang.String variableName)
Creates source code for an additional constructor that deals with default values as specified in the XML schema instance.

Overrides:
createDefaultValueWithString in class XSType
Parameters:
variableName - Name of the constructor argument.
Returns:
Source code for dealing with default values.

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:
createToJavaObjectCode in class XSType
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:
createFromJavaObjectCode in class XSType
Parameters:
variableName - The name of the Object.
Returns:
The String necessary to convert an Object to an instance of this XSType.

validationCode

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

Specified by:
validationCode in class XSType
Parameters:
jsc - The JSourceCode to fill in.
fixedValue - A fixed value to use if any.
validatorInstanceName - The name of the FieldValidator that the configured TypeValidator should be added to.


Copyright © 2011. All Rights Reserved.