|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.ispsoft.jaxme.generator.javaclasswriter.BasicJavaClassWriter
Field Summary | |
protected SourceWriterImpl |
sourceWriter
|
Constructor Summary | |
BasicJavaClassWriter(SourceWriterImpl pSourceWriter,
SchemaComplexElement pElement)
Creates a new instance of BasicJavaClassWriter |
Method Summary | |
protected void |
addRestrictions(JavaSource pSource,
JavaMethod pMethod,
SchemaAbstractSimpleElement pChild,
java.lang.String pFieldName,
java.lang.String pContext,
java.lang.String pIndent)
Adds handling for restrictions to the validateMe() method. |
protected void |
addValidationException(JavaMethod pMethod,
java.lang.Integer pErrorCode,
java.lang.String pIndent,
java.lang.String pMsg,
java.lang.String pContext)
Adds a ValidationException to the validateMe() method. |
protected void |
fillPrefixList(SchemaElement pElement,
java.util.Map pUris,
java.util.Set pPrefixes)
Fills the list generated by getPrefixListField(). |
protected int |
generateCloneFor(JavaMethod pJm,
SchemaElement pElement,
int i)
Clones a single attribute or child element. |
protected void |
generateField(JavaSource pJs,
SchemaElement pChild)
Generates a single attribute or subelement. |
protected void |
generateFields(SchemaElement pElement,
JavaSource pJs)
Adds properties for a complex elements attributes and subelements. |
protected JavaMethod |
getAddFieldMethod(JavaSource pJs,
SchemaElement pChild)
Creates a fields add method. |
protected java.util.Map |
getChildMap(java.util.Iterator pIterator)
|
protected JavaMethod |
getChildsToSAXMethod(JavaSource pJs)
Generates the childsToSAX() method. |
protected JavaMethod |
getCloneMethod()
Generates the clone() method. |
protected JavaConstructor |
getDefaultConstructor(JavaSource pJs)
Generates the default constructor. |
protected JavaConstructor |
getDefaultHandlerConstructor(JavaSource pJs)
Generates a default constructor for the handler class. |
protected JavaField |
getFieldDeclaration(JavaSource pJs,
SchemaElement pChild)
Generates a single attributes or subelements declaration. |
protected JavaMethod |
getGetAttributeMethod(JavaSource pJs)
Generates the methods getAttribute() method. |
protected JavaMethod |
getGetAttributesMethod()
Generates the method getAttributes() . |
protected JavaMethod |
getGetElementMethod(JavaSource pJs)
Generates the methods getElement() method. |
protected JavaMethod |
getGetFieldMethod(JavaSource pJs,
SchemaElement pChild)
Creates a fields get method. |
JavaMethod |
getGetPrefixListMethod()
Generates the getPrefixList method. |
JavaSource |
getHandlerClass()
Generates a JMContentHandler. |
java.util.List |
getImports()
Looks for additional import statements. |
protected JavaField |
getLocalNameField(JavaSource pJs)
Generates the local name field. |
protected boolean |
getLogWithLog4j()
Returns whether logging code for log4j should be generated. |
JavaSource |
getManagerClass()
Generates a JMManager class. |
protected JavaField |
getMyElemField(JavaSource pJs)
Generates the handles myelem field. |
protected JavaField |
getNamespaceUriField(JavaSource pJs)
Generates the namespace declaration field. |
protected JavaMethod |
getNewContentHandlerMethod(JavaSource pJs)
Generates the handlers newHandler() method. |
protected JavaMethod |
getNewResultNodeMethod(JavaSource pJs)
Generates a newResultNode() method for the
handler class. |
protected JavaField |
getPrefixListField(JavaSource pJs)
Generated the PREFIX_LIST field. |
protected JavaMethod |
getProcessResultNodeMethod(JavaSource pJs)
Generates the processResultNode() method. |
protected JavaConstructor |
getProtectedConstructor(JavaSource pJs)
Generates the protected constructor. |
protected JavaMethod |
getSetAttributeMethod(JavaSource pJs)
Generates the methods setAttribute() method. |
protected JavaMethod |
getSetFieldMethod(JavaSource pJs,
SchemaElement pChild)
Creates a fields set method. |
protected JavaField |
getStateField(JavaSource pJs)
Generates the handles state field. |
protected JavaMethod |
getValidateMeMethod(JavaSource pJs)
Generates the validateMe() method. |
protected JavaMethod |
getValidateMethod(JavaSource pJs)
Generates the validate() method. |
JavaSource |
getXmlClass()
Generates a JMAnyElement class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected SourceWriterImpl sourceWriter
Constructor Detail |
public BasicJavaClassWriter(SourceWriterImpl pSourceWriter, SchemaComplexElement pElement)
Method Detail |
protected boolean getLogWithLog4j()
Returns whether logging code for log4j should be generated.
protected JavaField getNamespaceUriField(JavaSource pJs)
Generates the namespace declaration field.
protected JavaField getLocalNameField(JavaSource pJs)
Generates the local name field.
protected JavaConstructor getDefaultConstructor(JavaSource pJs)
Generates the default constructor.
protected JavaConstructor getProtectedConstructor(JavaSource pJs)
Generates the protected constructor.
protected JavaField getFieldDeclaration(JavaSource pJs, SchemaElement pChild)
Generates a single attributes or subelements declaration.
protected JavaMethod getGetFieldMethod(JavaSource pJs, SchemaElement pChild)
Creates a fields get method.
protected JavaMethod getSetFieldMethod(JavaSource pJs, SchemaElement pChild)
Creates a fields set method.
protected JavaMethod getAddFieldMethod(JavaSource pJs, SchemaElement pChild)
Creates a fields add method.
protected void generateField(JavaSource pJs, SchemaElement pChild)
Generates a single attribute or subelement.
protected void generateFields(SchemaElement pElement, JavaSource pJs)
Adds properties for a complex elements attributes and subelements.
protected JavaMethod getGetElementMethod(JavaSource pJs)
Generates the methods getElement()
method.
protected JavaMethod getGetAttributeMethod(JavaSource pJs)
Generates the methods getAttribute()
method.
protected JavaMethod getSetAttributeMethod(JavaSource pJs)
Generates the methods setAttribute()
method.
protected JavaMethod getValidateMethod(JavaSource pJs)
Generates the validate()
method.
protected void addValidationException(JavaMethod pMethod, java.lang.Integer pErrorCode, java.lang.String pIndent, java.lang.String pMsg, java.lang.String pContext)
Adds a ValidationException to the validateMe()
method.
protected void addRestrictions(JavaSource pSource, JavaMethod pMethod, SchemaAbstractSimpleElement pChild, java.lang.String pFieldName, java.lang.String pContext, java.lang.String pIndent)
Adds handling for restrictions to the validateMe()
method.
protected JavaMethod getValidateMeMethod(JavaSource pJs) throws SchemaException
Generates the validateMe()
method.
SchemaException
protected JavaMethod getChildsToSAXMethod(JavaSource pJs)
Generates the childsToSAX() method.
protected JavaMethod getGetAttributesMethod()
Generates the method getAttributes()
.
protected int generateCloneFor(JavaMethod pJm, SchemaElement pElement, int i)
Clones a single attribute or child element.
protected JavaMethod getCloneMethod()
Generates the clone()
method.
public java.util.List getImports()
Looks for additional import statements.
protected void fillPrefixList(SchemaElement pElement, java.util.Map pUris, java.util.Set pPrefixes)
Fills the list generated by getPrefixListField().
pElement
- The element to search for namespace declarations.pUris
- A Map of namespace/prefix pairs.pPrefixes
- A Set of prefixes in pUris; note that this implies
that neither namespaces nor prefixes can be declared twice.protected JavaField getPrefixListField(JavaSource pJs)
Generated the PREFIX_LIST field.
public JavaMethod getGetPrefixListMethod()
Generates the getPrefixList method.
public JavaSource getXmlClass() throws java.lang.Exception
Generates a JMAnyElement class.
getXmlClass
in interface JavaClassWriter
java.lang.Exception
public JavaSource getManagerClass()
Generates a JMManager class.
getManagerClass
in interface JavaClassWriter
protected JavaConstructor getDefaultHandlerConstructor(JavaSource pJs)
Generates a default constructor for the handler class.
protected JavaMethod getNewResultNodeMethod(JavaSource pJs)
Generates a newResultNode()
method for the
handler class.
protected JavaField getMyElemField(JavaSource pJs)
Generates the handles myelem
field.
protected JavaField getStateField(JavaSource pJs)
Generates the handles state
field.
protected JavaMethod getNewContentHandlerMethod(JavaSource pJs)
Generates the handlers newHandler()
method.
protected JavaMethod getProcessResultNodeMethod(JavaSource pJs)
Generates the processResultNode()
method.
public JavaSource getHandlerClass()
Generates a JMContentHandler.
getHandlerClass
in interface JavaClassWriter
protected java.util.Map getChildMap(java.util.Iterator pIterator)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |