1 19 package org.netbeans.modules.javacore.jmiimpl.javamodel; 20 21 import java.util.List ; 22 import org.netbeans.jmi.javamodel.*; 23 import org.netbeans.mdr.storagemodel.StorableClass; 24 import org.netbeans.modules.javacore.parser.TypeRef; 25 26 30 public abstract class AttributeClassImpl extends SemiPersistentClass implements AttributeClass { 31 32 33 public AttributeClassImpl(StorableClass s) { 34 super(s); 35 } 36 37 public Attribute createAttribute() { 38 return create(null, null, 0, null, null, null, null, null); 39 } 40 41 public Attribute createAttribute(String name, 42 List annotations, 43 int modifiers, 44 String javadocText, 45 JavaDoc javadoc, 46 TypeReference typeName, 47 InitialValue defaultValue, 48 String defaultValueText) 49 { 50 return create(name, annotations, modifiers, javadocText, javadoc, typeName, defaultValue, defaultValueText); 51 } 52 53 protected AttributeImpl create(String name, 55 List annotations, 56 int modifiers, 57 String javadocText, 58 JavaDoc javadoc, 59 TypeReference typeName, 60 InitialValue defaultValue, 61 String defaultValueText) 62 { 63 AttributeImpl result; 64 result = (AttributeImpl) create(name, modifiers, null, false); 65 result.setNew(); 66 result.setData(annotations, javadocText, javadoc, typeName, defaultValue, defaultValueText); 67 return result; 68 } 69 70 public AttributeImpl create(String name, int modifiers, TypeRef type, boolean isTransient) { 71 AttributeImpl result; 72 if (isTransient) { 73 result = (AttributeImpl) createTransient(); 74 boolean changes = result.disableChanges; 75 result.disableChanges = true; 76 try { 77 result.setName(name); 78 result.setModifiers(modifiers); 79 } finally { 80 result.disableChanges = changes; 81 } 82 } else { 83 result = (AttributeImpl) super_createAttribute(name, null, modifiers, null, null, null, null, null); 84 } 85 result.setTypeRef(type); 86 return result; 87 } 88 89 protected abstract Attribute super_createAttribute(); 90 91 protected abstract Attribute super_createAttribute(String name, 92 List annotations, 93 int modifiers, 94 String javadocText, 95 JavaDoc javadoc, 96 TypeReference typeName, 97 InitialValue defaultValue, 98 String defaultValueText); 99 } 100 | Popular Tags |