public abstract class AbstractCodeGeneratorClass extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractCodeGeneratorClass.Signature |
protected static class |
AbstractCodeGeneratorClass.Signatures |
| Constructor and Description |
|---|
AbstractCodeGeneratorClass() |
| Modifier and Type | Method and Description |
|---|---|
org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property |
addProperty(String name,
String dtdName,
String namespace,
GraphNode node,
GraphLink l,
String classType,
int nestedLevel,
int eltInstance,
int groupInstance,
int type,
boolean ored,
AttrProp[] propAttributes,
String constName,
String defaultValue,
boolean directChild,
List extraData,
boolean isUnion)
This method is called by the BeanBuilder to register a new property
on this bean class.
|
protected int |
beanTree(GraphLink l,
StringBuffer str,
String indent,
String indentBy,
int lineCount) |
protected void |
begin() |
protected void |
beginNoI18N() |
protected void |
comment() |
protected void |
comment(String s) |
protected void |
comment(String s,
String s2) |
protected String |
commonBeanType()
All generated beans are at least this type.
|
protected int |
countNumberOfNonAttributeProperties() |
protected int |
countNumberOfNonAttributePropertiesRecurse(org.netbeans.modules.schema2beansdev.BeanBuilder.BeanElement be) |
protected void |
cr() |
protected int |
dumpAttributes(GraphNode elt,
StringBuffer str,
String indent,
int lineCount) |
protected int |
dumpBeanTree(org.netbeans.modules.schema2beansdev.BeanBuilder.BeanElement be,
StringBuffer str,
String indent,
String indentBy,
int lineCount) |
void |
dumpBeanTree(Writer out,
String indent,
String indentBy) |
protected void |
end() |
protected void |
end(boolean cr) |
protected void |
endNoI18N() |
protected void |
eol() |
protected void |
eol(boolean cr) |
protected void |
eolNoI18N() |
protected void |
findAttributeOwners()
Once all properties have been added to this Bean, call this method
to figure out for attribute property who it's owner is.
|
protected org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property |
findProperty(AttrProp attr) |
protected static String |
firstInCommaSeparatedList(String lst)
Returns the first element in a command separated list
|
protected void |
gen(AbstractCodeGeneratorClass.Signature sig) |
protected void |
gen(int a) |
protected void |
gen(int a,
int b,
int c,
int d,
String s) |
protected void |
gen(int a,
int b,
int c,
String s) |
protected void |
gen(int a,
int b,
String s) |
protected void |
gen(int a,
int b,
String s,
String s2) |
protected void |
gen(int a,
String s) |
protected void |
gen(int a,
String s,
String s2) |
protected void |
gen(String s) |
protected void |
gen(StringBuffer s) |
protected void |
gen(String s1,
String s2) |
protected void |
gen(String s1,
String s2,
String s3) |
protected void |
genCopy(String src,
org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a,
String justData) |
protected boolean |
genCopyWillCopy(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a) |
protected void |
gencr(int a,
int b,
int c,
String s) |
protected void |
gencr(int a,
int b,
String s) |
protected void |
gencr(int a,
int b,
String s,
String s2) |
protected void |
gencr(int a,
String s) |
protected void |
gencr(int a,
String s,
String s2) |
protected void |
gencr(String s) |
protected void |
gencr(String s,
String s2) |
protected void |
gencrNoI18N(String s) |
protected void |
gencrNoI18N(String s,
String s2) |
protected void |
genDefaultsAccessable(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a) |
protected void |
geneol(String s) |
abstract void |
generate(OutputStream out,
MetaDD mdd) |
void |
generate(String filename,
MetaDD mdd)
Generate the java code in the out stream, using the optional
metaDD bean graph.
|
protected void |
generateDelegator(JavaWriter.Method method,
String delegatorClassName) |
void |
generateDelegator(OutputStream out,
MetaDD mdd,
String delegatorClassName,
String delegatorPackageName) |
protected void |
generateDelegatorConstructors(String delegatorClassName) |
protected void |
generateSwitches() |
protected void |
genforprop() |
protected void |
genForRestrictions(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a,
String attr) |
protected void |
gengetprop() |
protected void |
gengetpropbyname() |
protected void |
genInvalidName(String var) |
protected void |
genNewDefault(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property prop,
boolean wantConcreteType) |
protected String |
genNewMethod(String abstractType,
String concreteType) |
protected String |
genNewMethod(String abstractType,
String concreteType,
String concreteFullTypeName)
Generate a method that will get a new instance of some type.
|
protected void |
genResetMutuallyExclusive(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a,
boolean genTest)
Generate commands for resetting the mutually exclusive properties,
only if isMutuallyExclusive(a) returns true.
|
protected void |
genRethrowExceptions(List exceps) |
protected void |
genSetValP(boolean b,
String s1,
String s2) |
protected void |
genSetValue(boolean isScalar,
String classType) |
protected void |
gensig1(String s) |
protected void |
gensig2(String s) |
protected void |
gentab(int n) |
protected abstract void |
genValidateFail(String detail,
String name,
boolean quoteDetail,
ValidateException.FailureType ft,
JavaWriter out) |
protected void |
genValidateIf(String test,
String name,
ValidateException.FailureType ft,
JavaWriter out) |
protected void |
genValidateProperties() |
protected void |
genWhiteSpaceRestriction(SchemaRep.WhiteSpace ws,
String var,
String type) |
protected void |
get(String s) |
String |
getDefaultNamespace() |
Collection |
getGeneratedMethods() |
protected void |
geti(String s) |
protected void |
getidx(String s,
boolean b) |
protected MetaElement |
getMetaElement(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property prop) |
protected MetaElement |
getMetaElement(org.netbeans.modules.schema2beansdev.BeanBuilder.BeanElement be) |
protected MetaElement |
getMetaElement(String dtdName,
String namespace) |
protected MetaProperty |
getMetaProperty(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property prop) |
protected MetaProperty |
getMetaProperty(String name) |
List |
getPropertyList() |
protected String |
getRootClassName() |
protected AbstractCodeGeneratorClass.Signatures |
getSignatures(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a) |
protected String |
getTypeFullClassName(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a) |
protected String |
getTypeFullClassName(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a,
String typeName) |
protected boolean |
hasDeepCopyConstructor() |
protected void |
init(org.netbeans.modules.schema2beansdev.BeanBuilder.BeanElement be,
GenBeans.Config config) |
protected boolean |
isCloneCallNeededOnType(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property prop) |
protected boolean |
isMutableType(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property prop) |
protected boolean |
isMutuallyExclusive(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a) |
protected boolean |
isTypeQName(String type) |
protected void |
noI18N() |
protected String |
parentBeanType() |
protected void |
PC() |
protected void |
PO() |
protected void |
printComment(String indent) |
protected void |
printGenBuffers(OutputStream out) |
protected void |
printSchema()
Send the schema to the current output channel.
|
protected void |
resetGenBuffers() |
protected void |
select(int o) |
void |
setDefaultNamespace(String ns) |
void |
setIndent(String indent) |
void |
setPackageName(String n) |
void |
setPrefixGuesser(PrefixGuesser guesser) |
void |
setRootBeanElement(org.netbeans.modules.schema2beansdev.BeanBuilder.BeanElement element) |
protected void |
sp() |
protected void |
tabIn() |
protected String |
testIfPropertyNotSet(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property prop) |
protected String |
testIfPropertySet(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property prop) |
String |
toString() |
protected GenBeans.Config config
protected String packageName
protected String className
protected String fullClassName
protected org.netbeans.modules.schema2beansdev.BeanBuilder.BeanElement beanElement
protected org.netbeans.modules.schema2beansdev.BeanBuilder.BeanElement rootBeanElement
protected MetaDD mdd
protected MetaElement metaElement
protected Map generatedNewMethods
protected ArrayList attrList
protected PrefixGuesser prefixGuesser
protected int HEADER_SECTION
protected int DECL_SECTION
protected int CONSTRUCTOR_SECTION
protected int INITIALIZE_SECTION
protected int ACCESS_SECTION
protected int NEW_METHOD_SECTION
protected int BODY_SECTION
protected int EQUALS_SECTION
protected int HASHCODE_SECTION
protected int TRAILER_SECTION
protected int MAXVALUE
protected static final int PUBLIC
protected static final int PRIVATE
protected static final int VOID
protected static final int CLASS
protected static final int IMPORT
protected static final int PACKAGE
protected static final int STRING
protected static final int BOOLEAN
protected static final int STATIC
protected static final int FINAL
protected static final int INT
protected static final int PROTECTED
protected static final String[] arrKeywords
public static final int MAX_DUMP_TREE_LINE_COUNT
protected static final AbstractCodeGeneratorClass.Signature.TypeOfMethod SETTER
protected static final AbstractCodeGeneratorClass.Signature.TypeOfMethod SETTERINDEXED
protected static final AbstractCodeGeneratorClass.Signature.TypeOfMethod GETTER
protected static final AbstractCodeGeneratorClass.Signature.TypeOfMethod GETTERLIST
protected static final AbstractCodeGeneratorClass.Signature.TypeOfMethod GETTERINDEXED
protected static final AbstractCodeGeneratorClass.Signature.TypeOfMethod SIZE
protected static final AbstractCodeGeneratorClass.Signature.TypeOfMethod ADD
protected static final AbstractCodeGeneratorClass.Signature.TypeOfMethod REMOVE
protected static final AbstractCodeGeneratorClass.Signature.TypeOfMethod OTHER
protected void genInvalidName(String var) throws IOException
IOExceptionprotected boolean isMutableType(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property prop)
protected boolean isCloneCallNeededOnType(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property prop)
protected boolean genCopyWillCopy(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a)
protected void genCopy(String src, org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a, String justData) throws IOException
IOExceptionprotected boolean isTypeQName(String type)
protected void init(org.netbeans.modules.schema2beansdev.BeanBuilder.BeanElement be,
GenBeans.Config config)
protected void resetGenBuffers()
protected void printGenBuffers(OutputStream out) throws IOException
IOExceptionpublic void setPackageName(String n)
public void setDefaultNamespace(String ns)
public String getDefaultNamespace()
protected String getTypeFullClassName(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a)
a - is the Property in questiontypeName - is the name of the type of @param a, could include "[]"protected String getTypeFullClassName(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a, String typeName)
public void setIndent(String indent)
public void setRootBeanElement(org.netbeans.modules.schema2beansdev.BeanBuilder.BeanElement element)
protected String getRootClassName()
protected void findAttributeOwners()
protected org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property findProperty(AttrProp attr)
protected void select(int o)
protected void gen(String s)
protected void gen(StringBuffer s)
protected void gen(int a)
protected void gen(int a,
String s)
protected void gen(int a,
int b,
String s)
protected void gen(int a,
int b,
int c,
String s)
protected void gen(int a,
int b,
int c,
int d,
String s)
protected void gencr(String s)
protected void gencr(int a,
String s)
protected void gencr(int a,
int b,
String s)
protected void gencr(int a,
int b,
int c,
String s)
protected void get(String s)
protected void geti(String s)
protected void getidx(String s, boolean b)
protected void cr()
protected void geneol(String s)
protected void PO()
protected void PC()
protected void begin()
protected void end()
protected void end(boolean cr)
protected void comment()
protected void gencrNoI18N(String s)
protected void beginNoI18N()
protected void endNoI18N()
protected void noI18N()
protected void comment(String s)
protected void eol()
protected void eol(boolean cr)
protected void eolNoI18N()
protected void sp()
protected void genforprop()
protected void gengetprop()
protected void gengetpropbyname()
protected void gensig1(String s)
protected void gensig2(String s)
protected void tabIn()
protected void gentab(int n)
protected void genSetValue(boolean isScalar,
String classType)
public org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property addProperty(String name, String dtdName, String namespace, GraphNode node, GraphLink l, String classType, int nestedLevel, int eltInstance, int groupInstance, int type, boolean ored, AttrProp[] propAttributes, String constName, String defaultValue, boolean directChild, List extraData, boolean isUnion)
public List getPropertyList()
public void generate(String filename, MetaDD mdd) throws IOException
IOExceptionpublic abstract void generate(OutputStream out, MetaDD mdd) throws IOException
IOExceptionprotected MetaElement getMetaElement(org.netbeans.modules.schema2beansdev.BeanBuilder.BeanElement be)
protected MetaElement getMetaElement(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property prop)
protected MetaElement getMetaElement(String dtdName, String namespace)
protected MetaProperty getMetaProperty(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property prop)
protected MetaProperty getMetaProperty(String name)
protected void printSchema()
throws IOException
IOExceptionprotected void printComment(String indent) throws IOException
IOExceptionpublic void dumpBeanTree(Writer out, String indent, String indentBy) throws IOException
IOExceptionprotected int dumpBeanTree(org.netbeans.modules.schema2beansdev.BeanBuilder.BeanElement be,
StringBuffer str,
String indent,
String indentBy,
int lineCount)
protected int dumpAttributes(GraphNode elt, StringBuffer str, String indent, int lineCount)
protected int beanTree(GraphLink l, StringBuffer str, String indent, String indentBy, int lineCount)
protected void gen(AbstractCodeGeneratorClass.Signature sig) throws IOException
IOExceptionprotected AbstractCodeGeneratorClass.Signatures getSignatures(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a)
public void generateDelegator(OutputStream out, MetaDD mdd, String delegatorClassName, String delegatorPackageName) throws IOException
IOExceptionprotected void generateDelegatorConstructors(String delegatorClassName) throws IOException
IOExceptionprotected void generateDelegator(JavaWriter.Method method, String delegatorClassName) throws IOException
IOExceptionprotected void genWhiteSpaceRestriction(SchemaRep.WhiteSpace ws, String var, String type) throws IOException
var - The name of a variable.IOExceptionprotected void genRethrowExceptions(List exceps)
protected void genValidateProperties()
throws IOException
IOExceptionprotected void genForRestrictions(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a,
String attr)
throws IOException
IOExceptionprotected void genValidateIf(String test, String name, ValidateException.FailureType ft, JavaWriter out) throws IOException
IOExceptionprotected abstract void genValidateFail(String detail, String name, boolean quoteDetail, ValidateException.FailureType ft, JavaWriter out) throws IOException
IOExceptionpublic Collection getGeneratedMethods()
protected void genDefaultsAccessable(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a)
throws IOException
IOExceptionprotected void generateSwitches()
throws IOException
IOExceptionprotected boolean isMutuallyExclusive(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a)
protected void genResetMutuallyExclusive(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property a,
boolean genTest)
throws IOException
IOExceptionprotected String commonBeanType()
protected String parentBeanType()
protected static String firstInCommaSeparatedList(String lst)
protected String genNewMethod(String abstractType, String concreteType) throws IOException
IOExceptionprotected String genNewMethod(String abstractType, String concreteType, String concreteFullTypeName) throws IOException
abstractType - interface name to use as return type, if
null, then concreteType is used.concreteType - the class to get a new instance ofconcreteFullTypeName - the full name of the concreteTypeIOExceptionprotected void genNewDefault(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property prop,
boolean wantConcreteType)
throws IOException
IOExceptionprotected boolean hasDeepCopyConstructor()
protected String testIfPropertySet(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property prop)
protected String testIfPropertyNotSet(org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass.Property prop)
protected int countNumberOfNonAttributeProperties()
protected int countNumberOfNonAttributePropertiesRecurse(org.netbeans.modules.schema2beansdev.BeanBuilder.BeanElement be)
public void setPrefixGuesser(PrefixGuesser guesser)
Copyright © 2017–2019 Eclipse Foundation. All rights reserved.