1 19 package org.netbeans.modules.javacore.jmiimpl.javamodel; 20 21 import org.netbeans.jmi.javamodel.Initializer; 22 import org.netbeans.jmi.javamodel.InitializerClass; 23 import org.netbeans.jmi.javamodel.JavaDoc; 24 import org.netbeans.jmi.javamodel.StatementBlock; 25 import org.netbeans.mdr.storagemodel.StorableClass; 26 import java.util.List ; 27 28 33 public abstract class InitializerClassImpl extends SemiPersistentClass implements InitializerClass { 34 35 protected InitializerClassImpl(StorableClass s) { 36 super(s); 37 } 38 39 43 public Initializer createInitializer() { 44 return create(null, 0, null, null, null, null); 45 } 46 47 59 public Initializer createInitializer(java.lang.String name, List annotations, int modifiers, java.lang.String javadocText, JavaDoc javadoc, StatementBlock body, java.lang.String bodyText) { 60 return create(annotations, modifiers, javadocText, javadoc, body, bodyText); 61 } 62 63 private Initializer create(List annotations, int modifiers, java.lang.String javadocText, JavaDoc javadoc, StatementBlock body, java.lang.String bodyText) { 64 InitializerImpl result = create(modifiers, false); 65 result.setNew(); 66 result.setData(annotations, javadocText, javadoc, body, bodyText); 67 return result; 68 } 69 70 public InitializerImpl create(int modifiers, boolean isTransient) { 71 if (isTransient) { 72 InitializerImpl result = (InitializerImpl) createTransient(); 73 boolean changes = result.disableChanges; 74 result.disableChanges = true; 75 try { 76 result.setModifiers(modifiers); 77 } finally { 78 result.disableChanges = changes; 79 } 80 return result; 81 } else { 82 return (InitializerImpl) super_createInitializer(null, null, modifiers, null, null, null, null); 83 } 84 } 85 86 protected abstract Initializer super_createInitializer(); 87 protected abstract Initializer super_createInitializer(java.lang.String name, List annotations, int modifiers, java.lang.String javadocText, JavaDoc javadoc, StatementBlock body, java.lang.String bodyText); 88 } 89 | Popular Tags |