Public Member Functions | |
JSourceCode () | |
JSourceCode (String sourceCode) | |
void | add (String statement) |
void | add (String statement, short indentSize) |
void | addIndented (String statement) |
void | append (String segment) |
void | clear () |
void | copyInto (JSourceCode jsc) |
void | indent () |
boolean | isEmpty () |
void | print (JSourceWriter jsw) |
void | unindent () |
String | toString () |
A class for holding in-memory Java source code.
org.exolab.javasource.JSourceCode.JSourceCode | ( | ) |
Creates an empty JSourceCode
org.exolab.javasource.JSourceCode.JSourceCode | ( | String | sourceCode | ) |
Creates a JSourceCode and adds the given String to it's contents
sourceCode | the source to add |
void org.exolab.javasource.JSourceCode.add | ( | String | statement | ) |
Adds the given statement to this JSourceCode. The statement will be added on a new line.
statement | the statement to add |
Referenced by org.exolab.javasource.JSourceCode.append(), org.exolab.castor.builder.IdentityInfo.createAccessMethods(), org.exolab.castor.builder.FieldInfo.createAccessMethods(), org.exolab.castor.builder.CollectionInfoODMG30.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfoJ2.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfo.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createAddMethod(), org.exolab.castor.builder.CollectionInfoJ2.createAddMethod(), org.exolab.castor.builder.CollectionInfo.createAddMethod(), org.exolab.castor.builder.CollectionInfo.createBoundPropertyCode(), org.exolab.castor.builder.CollectionInfoJ2.createClearMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createEnumerateMethod(), org.exolab.castor.builder.CollectionInfoJ2.createEnumerateMethod(), org.exolab.castor.builder.CollectionInfo.createEnumerateMethod(), org.exolab.castor.builder.SourceFactory.createEqualsMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetCollectionReferenceMethod(), org.exolab.castor.builder.CollectionInfo.createGetCollectionReferenceMethod(), org.exolab.castor.builder.CollectionInfo.createGetCountMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createGetMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetMethod(), org.exolab.castor.builder.CollectionInfo.createGetMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createRemoveAllMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveAllMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveAllMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createRemoveByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveByObjectMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveByObjectMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfo.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetCollectionMethod(), org.exolab.castor.builder.CollectionInfo.createSetCollectionMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetCollectionReferenceMethod(), org.exolab.castor.builder.CollectionInfo.createSetCollectionReferenceMethod(), org.exolab.castor.builder.DescriptorSourceFactory.createSource(), org.exolab.castor.builder.SourceFactory.createTestableMethods(), org.exolab.castor.builder.FieldInfo.generateInitializerCode(), org.exolab.castor.builder.CollectionInfoODMG30.generateInitializerCode(), org.exolab.castor.builder.CollectionInfoJ2.generateInitializerCode(), org.exolab.castor.builder.CollectionInfo.generateInitializerCode(), org.exolab.castor.builder.CollectionInfo.getReadMethod(), org.exolab.javasource.JClass.main(), org.exolab.castor.builder.types.XSTime.validationCode(), org.exolab.castor.builder.types.XSString.validationCode(), org.exolab.castor.builder.types.XSShort.validationCode(), org.exolab.castor.builder.types.XSNormalizedString.validationCode(), org.exolab.castor.builder.types.XSNMToken.validationCode(), org.exolab.castor.builder.types.XSNCName.validationCode(), org.exolab.castor.builder.types.XSLong.validationCode(), org.exolab.castor.builder.types.XSInteger.validationCode(), org.exolab.castor.builder.types.XSInt.validationCode(), org.exolab.castor.builder.types.XSGYearMonth.validationCode(), org.exolab.castor.builder.types.XSGYear.validationCode(), org.exolab.castor.builder.types.XSGMonthDay.validationCode(), org.exolab.castor.builder.types.XSGMonth.validationCode(), org.exolab.castor.builder.types.XSGDay.validationCode(), org.exolab.castor.builder.types.XSFloat.validationCode(), org.exolab.castor.builder.types.XSDuration.validationCode(), org.exolab.castor.builder.types.XSDouble.validationCode(), org.exolab.castor.builder.types.XSDecimal.validationCode(), org.exolab.castor.builder.types.XSDate.validationCode(), org.exolab.castor.builder.types.XSByte.validationCode(), and org.exolab.castor.builder.types.XSBoolean.validationCode().
void org.exolab.javasource.JSourceCode.add | ( | String | statement, | |
short | indentSize | |||
) |
Adds the given statement to this JSourceCode. The statement will be added on a new line.
statement | the statement to add | |
the | indentSize is the size of the indentation to use when printing this JSourceCode |
void org.exolab.javasource.JSourceCode.addIndented | ( | String | statement | ) |
Adds the given statement to this JSourceCode. The statement will be added on a new line and added with increased indent. This is a convenience method for the sequence indent(); add(statement); unindent();
statement | the statement to add |
References org.exolab.javasource.JSourceCode.indent(), and org.exolab.javasource.JSourceCode.unindent().
void org.exolab.javasource.JSourceCode.append | ( | String | segment | ) |
Appends the given String to the last line in this JSourceCode
segment | the String to append |
References org.exolab.javasource.JSourceCode.add(), and org.exolab.javasource.JCodeStatement.append().
Referenced by org.exolab.castor.builder.IdentityInfo.createAccessMethods(), org.exolab.castor.builder.CollectionInfoODMG30.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfoJ2.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfo.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createAddMethod(), org.exolab.castor.builder.CollectionInfoJ2.createAddMethod(), org.exolab.castor.builder.CollectionInfo.createAddMethod(), org.exolab.castor.builder.CollectionInfo.createBoundPropertyCode(), org.exolab.castor.builder.CollectionInfoJ2.createClearMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createEnumerateMethod(), org.exolab.castor.builder.CollectionInfoJ2.createEnumerateMethod(), org.exolab.castor.builder.CollectionInfo.createEnumerateMethod(), org.exolab.castor.builder.SourceFactory.createEqualsMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetCollectionReferenceMethod(), org.exolab.castor.builder.CollectionInfo.createGetCollectionReferenceMethod(), org.exolab.castor.builder.CollectionInfo.createGetCountMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createGetMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetMethod(), org.exolab.castor.builder.CollectionInfo.createGetMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createRemoveAllMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveAllMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveAllMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createRemoveByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveByObjectMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveByObjectMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfo.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetCollectionMethod(), org.exolab.castor.builder.CollectionInfo.createSetCollectionMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetCollectionReferenceMethod(), org.exolab.castor.builder.CollectionInfo.createSetCollectionReferenceMethod(), org.exolab.castor.builder.DescriptorSourceFactory.createSource(), org.exolab.castor.builder.SourceFactory.createTestableMethods(), org.exolab.castor.builder.CollectionInfoODMG30.generateInitializerCode(), org.exolab.castor.builder.CollectionInfoJ2.generateInitializerCode(), org.exolab.castor.builder.CollectionInfo.generateInitializerCode(), org.exolab.castor.builder.CollectionInfo.getReadMethod(), org.exolab.castor.builder.types.XSTime.validationCode(), org.exolab.castor.builder.types.XSString.validationCode(), org.exolab.castor.builder.types.XSShort.validationCode(), org.exolab.castor.builder.types.XSNormalizedString.validationCode(), org.exolab.castor.builder.types.XSLong.validationCode(), org.exolab.castor.builder.types.XSInteger.validationCode(), org.exolab.castor.builder.types.XSInt.validationCode(), org.exolab.castor.builder.types.XSGYearMonth.validationCode(), org.exolab.castor.builder.types.XSGYear.validationCode(), org.exolab.castor.builder.types.XSGMonthDay.validationCode(), org.exolab.castor.builder.types.XSGMonth.validationCode(), org.exolab.castor.builder.types.XSGDay.validationCode(), org.exolab.castor.builder.types.XSFloat.validationCode(), org.exolab.castor.builder.types.XSDuration.validationCode(), org.exolab.castor.builder.types.XSDouble.validationCode(), org.exolab.castor.builder.types.XSDecimal.validationCode(), org.exolab.castor.builder.types.XSDate.validationCode(), org.exolab.castor.builder.types.XSByte.validationCode(), and org.exolab.castor.builder.types.XSBoolean.validationCode().
void org.exolab.javasource.JSourceCode.clear | ( | ) |
Clears all the code statements from this JSourceCode
void org.exolab.javasource.JSourceCode.copyInto | ( | JSourceCode | jsc | ) |
Copies the contents of this JSourceCode into the given JSourceCode
jsc | the JSourceCode to copy this JSourceCode into |
void org.exolab.javasource.JSourceCode.indent | ( | ) |
Increases the current indent level by 1
Referenced by org.exolab.javasource.JSourceCode.addIndented(), org.exolab.castor.builder.CollectionInfoODMG30.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfoJ2.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfo.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createAddMethod(), org.exolab.castor.builder.CollectionInfoJ2.createAddMethod(), org.exolab.castor.builder.CollectionInfo.createAddMethod(), org.exolab.castor.builder.SourceFactory.createEqualsMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createGetMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetMethod(), org.exolab.castor.builder.CollectionInfo.createGetMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfo.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetCollectionMethod(), org.exolab.castor.builder.CollectionInfo.createSetCollectionMethod(), org.exolab.castor.builder.SourceFactory.createTestableMethods(), org.exolab.castor.builder.FieldInfo.generateInitializerCode(), org.exolab.castor.builder.types.XSTime.validationCode(), org.exolab.castor.builder.types.XSGYearMonth.validationCode(), org.exolab.castor.builder.types.XSGYear.validationCode(), org.exolab.castor.builder.types.XSGMonthDay.validationCode(), org.exolab.castor.builder.types.XSGMonth.validationCode(), org.exolab.castor.builder.types.XSGDay.validationCode(), and org.exolab.castor.builder.types.XSDate.validationCode().
boolean org.exolab.javasource.JSourceCode.isEmpty | ( | ) |
Returns true if this JSourceCode is empty (ie. no source).
Referenced by org.exolab.javasource.JClass.print().
void org.exolab.javasource.JSourceCode.print | ( | JSourceWriter | jsw | ) |
Prints this JSourceCode to the given JSourceWriter
jsw | the JSourceWriter to print to |
References org.exolab.javasource.JSourceWriter.writeln().
Referenced by org.exolab.javasource.JMethod.print(), and org.exolab.javasource.JConstructor.print().
String org.exolab.javasource.JSourceCode.toString | ( | ) |
Returns the String representation of this JSourceCode
Referenced by org.exolab.javasource.JClass.print().
void org.exolab.javasource.JSourceCode.unindent | ( | ) |
Decreases the indent level by 1
Referenced by org.exolab.javasource.JSourceCode.addIndented(), org.exolab.castor.builder.CollectionInfoODMG30.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfoJ2.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfo.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createAddMethod(), org.exolab.castor.builder.CollectionInfoJ2.createAddMethod(), org.exolab.castor.builder.CollectionInfo.createAddMethod(), org.exolab.castor.builder.SourceFactory.createEqualsMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createGetMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetMethod(), org.exolab.castor.builder.CollectionInfo.createGetMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfo.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetCollectionMethod(), org.exolab.castor.builder.CollectionInfo.createSetCollectionMethod(), org.exolab.castor.builder.SourceFactory.createTestableMethods(), org.exolab.castor.builder.FieldInfo.generateInitializerCode(), org.exolab.castor.builder.types.XSTime.validationCode(), org.exolab.castor.builder.types.XSGYearMonth.validationCode(), org.exolab.castor.builder.types.XSGYear.validationCode(), org.exolab.castor.builder.types.XSGMonthDay.validationCode(), org.exolab.castor.builder.types.XSGMonth.validationCode(), org.exolab.castor.builder.types.XSGDay.validationCode(), and org.exolab.castor.builder.types.XSDate.validationCode().