de.ispsoft.jaxme.generator.types
Class SchemaSimpleTypeImpl

java.lang.Object
  extended byde.ispsoft.jaxme.generator.types.SchemaTypeImpl
      extended byde.ispsoft.jaxme.generator.types.SchemaSimpleTypeImpl
All Implemented Interfaces:
SchemaSimpleType, SchemaType
Direct Known Subclasses:
Base64BinaryType, BooleanType, ByteType, DateTimeType, DoubleType, FloatType, IntegerType, LongType, ShortType, SimpleTypeWrapper, StringType

public abstract class SchemaSimpleTypeImpl
extends SchemaTypeImpl
implements SchemaSimpleType

A default implementation for a simple SchemaType.

Author:
Jochen Wiedmann

Field Summary
 
Fields inherited from interface de.ispsoft.jaxme.generator.SchemaSimpleType
OP_INSERT, OP_UPDATE, OP_WHERE
 
Constructor Summary
SchemaSimpleTypeImpl(java.lang.String pNamespaceURI, java.lang.String pLocalName)
          Creates a new instance of SchemaSimpleTypeImpl
 
Method Summary
protected  java.lang.String castFromString(java.lang.String pParam)
          Deprecated. Will be removed in JaxMe 2
 java.lang.String castFromString(java.lang.String pParam, java.lang.String pUnmarshaller)
          Returns a piece of Java code converting a String into an an instance of this type.
protected  java.lang.String castToString(java.lang.String pParam)
          Deprecated. Will be removed in JaxMe 2
 java.lang.String castToString(java.lang.String pParam, java.lang.String pMarshaller)
          Returns a piece of Java code converting an instance of this type into a String.
 java.lang.String createPreparedStatementColumnName(SchemaAbstractSimpleElement pElement, int pMode, java.lang.String pColumnName)
          Creates SQL code for preparing a JDBC statement.
 java.lang.String createPreparedStatementColumnValue(SchemaAbstractSimpleElement pElement, int pMode)
          Creates SQL code for preparing a JDBC statement.
 int createPrepareStatement(SchemaAbstractSimpleElement pElement, JavaMethod pJm, int pNum, int pMode)
          Creates Java code for preparing a JDBC statement.
 void createSaxEvents(SchemaAbstractSimpleElement pElement, JavaMethod pJm, java.lang.String pFieldName, java.lang.String pMarshaller, java.lang.String pIndent)
          Creates Java code for firing SAX events.
 java.lang.String getClone(java.lang.String pValue)
          Returns a piece of Java code cloning an instance of this type.
 
Methods inherited from class de.ispsoft.jaxme.generator.types.SchemaTypeImpl
getClone, getLocalName, getNamespaceURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.ispsoft.jaxme.generator.SchemaSimpleType
castFromResultSet, castToPreparedStatement, getCompare, getPrimitiveRuntimeType, getQueryType, getRuntimeType, getSample, getSQLTypes, hasPrimitive
 
Methods inherited from interface de.ispsoft.jaxme.generator.SchemaType
getClone, getLocalName, getNamespaceURI, isComplex
 

Constructor Detail

SchemaSimpleTypeImpl

public SchemaSimpleTypeImpl(java.lang.String pNamespaceURI,
                            java.lang.String pLocalName)
Creates a new instance of SchemaSimpleTypeImpl

Method Detail

getClone

public java.lang.String getClone(java.lang.String pValue)

Returns a piece of Java code cloning an instance of this type.

Specified by:
getClone in interface SchemaSimpleType

createPrepareStatement

public int createPrepareStatement(SchemaAbstractSimpleElement pElement,
                                  JavaMethod pJm,
                                  int pNum,
                                  int pMode)

Creates Java code for preparing a JDBC statement.

Specified by:
createPrepareStatement in interface SchemaSimpleType
Parameters:
pElement - An atomic element whose value should be added as a parameter to the prepared statement
pJm - The Java method where to add source.
pNum - The parameter number: 1, 2, ...
pMode - Either of OP_INSERT, OP_UPDATE or OP_WHERE.
Returns:
The updated parameter number, if stmt.setXXX() was used.

createSaxEvents

public void createSaxEvents(SchemaAbstractSimpleElement pElement,
                            JavaMethod pJm,
                            java.lang.String pFieldName,
                            java.lang.String pMarshaller,
                            java.lang.String pIndent)

Creates Java code for firing SAX events.

Specified by:
createSaxEvents in interface SchemaSimpleType
Parameters:
pElement - An atomic element whose value should be converted into SAX events.
pJm - The Java method where to add source.
pFieldName - The field name to use for reading the values
pMarshaller - The field name of a Marshaller being used.
pIndent - String of blanks for indenting the generated source

createPreparedStatementColumnName

public java.lang.String createPreparedStatementColumnName(SchemaAbstractSimpleElement pElement,
                                                          int pMode,
                                                          java.lang.String pColumnName)

Creates SQL code for preparing a JDBC statement.

Specified by:
createPreparedStatementColumnName in interface SchemaSimpleType
Parameters:
pElement - An atomic element whose value should be added as a parameter to the prepared statement.
pMode - Either of OP_INSERT, OP_UPDATE or OP_WHERE.
pColumnName - A suggested column name.
Returns:
An SQL expression specifying a column name that is to be inserted or updated. NULL if the column should be omitted.

createPreparedStatementColumnValue

public java.lang.String createPreparedStatementColumnValue(SchemaAbstractSimpleElement pElement,
                                                           int pMode)

Creates SQL code for preparing a JDBC statement.

Specified by:
createPreparedStatementColumnValue in interface SchemaSimpleType
Parameters:
pElement - An atomic element whose value should be added as a parameter to the prepared statement.
pMode - Either of OP_INSERT, OP_UPDATE or OP_WHERE.
Returns:
An SQL expression specifying a column value that is to be inserted or updated. NULL if the column should be omitted.

castFromString

public java.lang.String castFromString(java.lang.String pParam,
                                       java.lang.String pUnmarshaller)
Description copied from interface: SchemaSimpleType

Returns a piece of Java code converting a String into an an instance of this type.

Specified by:
castFromString in interface SchemaSimpleType
Parameters:
pParam - The value being converted, typically a variable name.
pUnmarshaller - A value with an UnmarshallerImpl being used, typically a variable name.

castToString

public java.lang.String castToString(java.lang.String pParam,
                                     java.lang.String pMarshaller)
Description copied from interface: SchemaSimpleType

Returns a piece of Java code converting an instance of this type into a String.

Specified by:
castToString in interface SchemaSimpleType
Parameters:
pParam - The value being converted, typically a variable name.
pMarshaller - A value with a MarshallerImpl being used, typically a variable name.

castFromString

protected java.lang.String castFromString(java.lang.String pParam)
Deprecated. Will be removed in JaxMe 2


castToString

protected java.lang.String castToString(java.lang.String pParam)
Deprecated. Will be removed in JaxMe 2