1 16 package org.apache.ws.jaxme.js; 17 18 19 21 public abstract class JavaSourceObject extends IndentationEngineImpl { 22 protected JavaSourceObject(String pName, JavaQName pType, JavaSource.Protection pProtection) { 23 setName(pName); 24 setType(pType); 25 setProtection(pProtection); 26 } 27 28 protected JavaSourceObject(String pName, JavaQName pType) { 29 this(pName, pType, null); 30 } 31 32 protected JavaSourceObject(String pName, String pType, JavaSource.Protection pProtection) { 33 setName(pName); 34 if (pType == null) { 35 throw new NullPointerException ("Type must not be null"); 36 } 37 setType(JavaQNameImpl.getInstance(pType, true)); 38 setProtection(pProtection); 39 } 40 41 protected JavaSourceObject(String pName, String pType) { 42 this(pName, pType, null); 43 } 44 45 private String name; 46 49 public String getName() { return name; } 50 53 public void setName(String n) { name = n; } 54 55 private boolean isFinal = false; 56 60 public boolean isFinal() { return isFinal; } 61 65 public void setFinal(boolean pFinal) { isFinal = pFinal; } 66 67 private boolean isStatic = false; 68 71 public boolean isStatic() { return isStatic; } 72 75 public void setStatic(boolean pStatic) { isStatic = pStatic; } 76 77 private JavaQName type; 78 81 public JavaQName getType() { return type; } 82 85 public void setType(JavaQName t) { type = t; } 86 87 private JavaSource.Protection protection = JavaSource.DEFAULT_PROTECTION; 88 91 public JavaSource.Protection getProtection() { return protection; } 92 96 public void setProtection(JavaSource.Protection p) { 97 protection = (p == null) ? JavaSource.DEFAULT_PROTECTION : p; 98 } 99 100 private JavaComment comment; 101 104 public JavaComment getComment() { return comment; } 105 108 public JavaComment newComment() { 109 if (comment == null) { 110 comment = new JavaComment(); 111 return comment; 112 } else { 113 throw new IllegalStateException ("A Javadoc comment has already been created for this object."); 114 } 115 } 116 117 private boolean bAbstract = false; 118 120 public boolean isAbstract() { 121 return bAbstract; 122 } 123 125 public void setAbstract(boolean isAbstract) { 126 this.bAbstract = isAbstract; 127 } 128 129 private JavaSource javaSource; 130 protected void setJavaSource(JavaSource pSource) { 131 javaSource = pSource; 132 } 133 135 public JavaSource getJavaSource() { 136 return javaSource; 137 } 138 } | Popular Tags |