| java.lang.Object org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass org.netbeans.modules.schema2beansdev.BeanClass
BeanClass | public class BeanClass extends AbstractCodeGeneratorClass implements CodeGeneratorClass(Code) | | This class generates the bean classes code. There is one instance of
this class per bean to generate.
The BeanBuilder creates one instance of the BeanClass class for every
bean class to generate, and for each of these instances,
the BeanBuilder calls the addPropertyMethod() in order to populate the
list of properties contained by the bean. Then it calls the process()
method, which makes the class to generate its java output into
the output stream specified in the process parameter.
The BeanBuilder might give an optional MetaDD bean graph which contains
extra information that didn't exist in the dtd. The content of this graph
is used to generate extra information about the properties of the bean
(for example the default values, well known values, wrapper class)
|
Method Summary | |
protected void | addExtraMethods() | void | genAccessors(int out) | void | genAttribute(String name, AttrProp attr) | void | genAttributes(int out, AttrProp[] attributes, String name) | void | genBody(int out) | void | genClassName(int out) | void | genConstructor(int out) | void | genDeclarations(int out) | void | genHeader(int out) | void | genImports(int out) | void | genInitializer() This method needs to be run after genAccessors is run, so that
all of the a.isIndexed values are correct (for attributes). | void | genPackage(int out) | void | genTrailer(int out) | void | genValidate() | protected void | genValidateFail(String detail, String name, boolean quoteDetail, ValidateException.FailureType ft, JavaWriter out) | public void | generate(OutputStream out, MetaDD mdd) Generate the java code in the out stream, using the optional
metaDD bean graph. | void | setBeanName(String n) | public void | setInvalidPropertyNames(Map invalidNames) | boolean | shouldThrowException() | protected String | testIfPropertyNotSet(Property prop) | protected String | testIfPropertySet(Property prop) |
PCL_FULL_CLASS_NAME | final static String PCL_FULL_CLASS_NAME(Code) | | |
VCL_FULL_CLASS_NAME | final static String VCL_FULL_CLASS_NAME(Code) | | |
addExtraMethods | protected void addExtraMethods()(Code) | | |
genClassName | void genClassName(int out)(Code) | | |
genDeclarations | void genDeclarations(int out)(Code) | | |
genHeader | void genHeader(int out) throws IOException(Code) | | Generate the different parts of the class
|
genImports | void genImports(int out)(Code) | | |
genInitializer | void genInitializer() throws IOException(Code) | | This method needs to be run after genAccessors is run, so that
all of the a.isIndexed values are correct (for attributes).
|
genPackage | void genPackage(int out)(Code) | | |
genTrailer | void genTrailer(int out)(Code) | | |
setInvalidPropertyNames | public void setInvalidPropertyNames(Map invalidNames)(Code) | | |
shouldThrowException | boolean shouldThrowException()(Code) | | |
testIfPropertyNotSet | protected String testIfPropertyNotSet(Property prop)(Code) | | |
testIfPropertySet | protected String testIfPropertySet(Property prop)(Code) | | |
Methods inherited from org.netbeans.modules.schema2beansdev.AbstractCodeGeneratorClass | protected void PC()(Code)(Java Doc) protected void PO()(Code)(Java Doc) public 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)(Code)(Java Doc) protected int beanTree(GraphLink l, StringBuffer str, String indent, String indentBy, int lineCount)(Code)(Java Doc) protected void begin()(Code)(Java Doc) protected void beginNoI18N()(Code)(Java Doc) protected void comment()(Code)(Java Doc) protected void comment(String s)(Code)(Java Doc) protected void comment(String s, String s2)(Code)(Java Doc) protected String commonBeanType()(Code)(Java Doc) protected int countNumberOfNonAttributeProperties()(Code)(Java Doc) protected int countNumberOfNonAttributePropertiesRecurse(BeanBuilder.BeanElement be)(Code)(Java Doc) protected void cr()(Code)(Java Doc) protected int dumpAttributes(GraphNode elt, StringBuffer str, String indent, int lineCount)(Code)(Java Doc) public void dumpBeanTree(java.io.Writer out, String indent, String indentBy) throws java.io.IOException(Code)(Java Doc) protected int dumpBeanTree(BeanBuilder.BeanElement be, StringBuffer str, String indent, String indentBy, int lineCount)(Code)(Java Doc) protected void end()(Code)(Java Doc) protected void end(boolean cr)(Code)(Java Doc) protected void endNoI18N()(Code)(Java Doc) protected void eol()(Code)(Java Doc) protected void eol(boolean cr)(Code)(Java Doc) protected void eolNoI18N()(Code)(Java Doc) protected void findAttributeOwners()(Code)(Java Doc) protected Property findProperty(AttrProp attr)(Code)(Java Doc) protected static String firstInCommaSeparatedList(String lst)(Code)(Java Doc) protected void gen(String s)(Code)(Java Doc) protected void gen(StringBuffer s)(Code)(Java Doc) protected void gen(String s1, String s2)(Code)(Java Doc) protected void gen(String s1, String s2, String s3)(Code)(Java Doc) protected void gen(int a)(Code)(Java Doc) protected void gen(int a, String s)(Code)(Java Doc) protected void gen(int a, String s, String s2)(Code)(Java Doc) protected void gen(int a, int b, String s, String s2)(Code)(Java Doc) protected void gen(int a, int b, String s)(Code)(Java Doc) protected void gen(int a, int b, int c, String s)(Code)(Java Doc) protected void gen(int a, int b, int c, int d, String s)(Code)(Java Doc) protected void gen(Signature sig) throws IOException(Code)(Java Doc) protected void genCopy(String src, Property a, String justData) throws IOException(Code)(Java Doc) protected boolean genCopyWillCopy(Property a)(Code)(Java Doc) protected void genDefaultsAccessable(Property a) throws IOException(Code)(Java Doc) protected void genForRestrictions(Property a, String attr) throws IOException(Code)(Java Doc) protected void genInvalidName(String var) throws IOException(Code)(Java Doc) protected void genNewDefault(Property prop, boolean wantConcreteType) throws IOException(Code)(Java Doc) protected String genNewMethod(String abstractType, String concreteType) throws IOException(Code)(Java Doc) protected String genNewMethod(String abstractType, String concreteType, String concreteFullTypeName) throws IOException(Code)(Java Doc) protected void genResetMutuallyExclusive(Property a, boolean genTest) throws IOException(Code)(Java Doc) protected void genRethrowExceptions(List exceps)(Code)(Java Doc) protected void genSetValP(boolean b, String s1, String s2)(Code)(Java Doc) protected void genSetValue(boolean isScalar, String classType)(Code)(Java Doc) abstract protected void genValidateFail(String detail, String name, boolean quoteDetail, ValidateException.FailureType ft, JavaWriter out) throws IOException(Code)(Java Doc) protected void genValidateIf(String test, String name, ValidateException.FailureType ft, JavaWriter out) throws IOException(Code)(Java Doc) protected void genValidateProperties() throws IOException(Code)(Java Doc) protected void genWhiteSpaceRestriction(SchemaRep.WhiteSpace ws, String var, String type) throws IOException(Code)(Java Doc) protected void gencr(String s)(Code)(Java Doc) protected void gencr(String s, String s2)(Code)(Java Doc) protected void gencr(int a, String s)(Code)(Java Doc) protected void gencr(int a, String s, String s2)(Code)(Java Doc) protected void gencr(int a, int b, String s, String s2)(Code)(Java Doc) protected void gencr(int a, int b, String s)(Code)(Java Doc) protected void gencr(int a, int b, int c, String s)(Code)(Java Doc) protected void gencrNoI18N(String s)(Code)(Java Doc) protected void gencrNoI18N(String s, String s2)(Code)(Java Doc) protected void geneol(String s)(Code)(Java Doc) public void generate(String filename, MetaDD mdd) throws IOException(Code)(Java Doc) abstract public void generate(OutputStream out, MetaDD mdd) throws IOException(Code)(Java Doc) public void generateDelegator(OutputStream out, MetaDD mdd, String delegatorClassName, String delegatorPackageName) throws IOException(Code)(Java Doc) protected void generateDelegator(JavaWriter.Method method, String delegatorClassName) throws IOException(Code)(Java Doc) protected void generateDelegatorConstructors(String delegatorClassName) throws IOException(Code)(Java Doc) protected void generateSwitches() throws IOException(Code)(Java Doc) protected void genforprop()(Code)(Java Doc) protected void gengetprop()(Code)(Java Doc) protected void gengetpropbyname()(Code)(Java Doc) protected void gensig1(String s)(Code)(Java Doc) protected void gensig2(String s)(Code)(Java Doc) protected void gentab(int n)(Code)(Java Doc) protected void get(String s)(Code)(Java Doc) public String getDefaultNamespace()(Code)(Java Doc) public Collection getGeneratedMethods()(Code)(Java Doc) protected MetaElement getMetaElement(BeanBuilder.BeanElement be)(Code)(Java Doc) protected MetaElement getMetaElement(Property prop)(Code)(Java Doc) protected MetaElement getMetaElement(String dtdName, String namespace)(Code)(Java Doc) protected MetaProperty getMetaProperty(Property prop)(Code)(Java Doc) protected MetaProperty getMetaProperty(String name)(Code)(Java Doc) public List getPropertyList()(Code)(Java Doc) protected String getRootClassName()(Code)(Java Doc) protected Signatures getSignatures(Property a)(Code)(Java Doc) protected String getTypeFullClassName(Property a)(Code)(Java Doc) protected String getTypeFullClassName(Property a, String typeName)(Code)(Java Doc) protected void geti(String s)(Code)(Java Doc) protected void getidx(String s, boolean b)(Code)(Java Doc) protected boolean hasDeepCopyConstructor()(Code)(Java Doc) protected void init(BeanBuilder.BeanElement be, GenBeans.Config config)(Code)(Java Doc) protected boolean isCloneCallNeededOnType(Property prop)(Code)(Java Doc) protected boolean isMutableType(Property prop)(Code)(Java Doc) protected boolean isMutuallyExclusive(Property a)(Code)(Java Doc) protected boolean isTypeQName(String type)(Code)(Java Doc) protected void noI18N()(Code)(Java Doc) protected String parentBeanType()(Code)(Java Doc) protected void printComment(String indent) throws IOException(Code)(Java Doc) protected void printGenBuffers(OutputStream out) throws IOException(Code)(Java Doc) protected void printSchema() throws IOException(Code)(Java Doc) protected void resetGenBuffers()(Code)(Java Doc) protected void select(int o)(Code)(Java Doc) public void setDefaultNamespace(String ns)(Code)(Java Doc) public void setIndent(String indent)(Code)(Java Doc) public void setPackageName(String n)(Code)(Java Doc) public void setPrefixGuesser(PrefixGuesser guesser)(Code)(Java Doc) public void setRootBeanElement(BeanBuilder.BeanElement element)(Code)(Java Doc) protected void sp()(Code)(Java Doc) protected void tabIn()(Code)(Java Doc) protected String testIfPropertyNotSet(Property prop)(Code)(Java Doc) protected String testIfPropertySet(Property prop)(Code)(Java Doc) public String toString()(Code)(Java Doc)
|
|
|