1 19 package org.netbeans.modules.javacore.jmiimpl.javamodel; 20 21 import java.util.Arrays ; 22 import java.util.List ; 23 24 import org.netbeans.jmi.javamodel.Constructor; 25 import org.netbeans.jmi.javamodel.ConstructorClass; 26 import org.netbeans.jmi.javamodel.JavaDoc; 27 import org.netbeans.jmi.javamodel.StatementBlock; 28 import org.netbeans.mdr.storagemodel.StorableClass; 29 import org.netbeans.modules.javacore.parser.TypeParamRef; 30 31 32 37 public abstract class ConstructorClassImpl extends SemiPersistentClass implements ConstructorClass { 38 protected ConstructorClassImpl(StorableClass s) { 39 super(s); 40 } 41 42 46 public Constructor createConstructor() { 47 return create(null, 0, null, null, null, null, null, null, null); 48 } 49 50 public Constructor createConstructor(java.lang.String name, List annotations, int modifiers, java.lang.String javadocText, JavaDoc javadoc, StatementBlock body, java.lang.String bodyText, List typeArguments, List parameters, List exceptionNames) { 51 return create(annotations, modifiers, javadocText, javadoc, body, bodyText, typeArguments, parameters, exceptionNames); 52 } 53 54 private Constructor create(List annotations, int modifiers, java.lang.String javadocText, JavaDoc javadoc, StatementBlock body, java.lang.String bodyText, List typeArguments, List parameters, List exceptionNames) { 55 ConstructorImpl result = create(modifiers, null, false); 56 result.setNew(); 57 result.setData(annotations, javadocText, javadoc, body, bodyText, typeArguments, parameters, exceptionNames); 58 return result; 59 } 60 61 public ConstructorImpl create(int modifiers, TypeParamRef[] exceptions, boolean isTransient) { 62 ConstructorImpl result; 63 if (isTransient) { 64 result = (ConstructorImpl) createTransient(); 65 boolean changes = result.disableChanges; 66 result.disableChanges = true; 67 try { 68 result.setModifiers(modifiers); 69 } finally { 70 result.disableChanges = changes; 71 } 72 } else { 73 result = (ConstructorImpl) super_createConstructor(null, null, modifiers, null, null, null, null, null, null, null); 74 } 75 result.setExceptionRefs(exceptions == null ? null : Arrays.asList(exceptions)); 76 return result; 77 } 78 79 protected abstract Constructor super_createConstructor(); 80 protected abstract Constructor super_createConstructor(java.lang.String name, List annotations, int modifiers, java.lang.String javadocText, JavaDoc javadoc, StatementBlock body, java.lang.String bodyText, List typeArguments, List parameters, List exceptionNames); 81 } 82 | Popular Tags |