1 19 package org.netbeans.modules.javacore.jmiimpl.javamodel; 20 21 import org.netbeans.jmi.javamodel.Field; 22 import org.netbeans.jmi.javamodel.FieldClass; 23 import org.netbeans.jmi.javamodel.TypeReference; 24 import org.netbeans.mdr.storagemodel.StorableClass; 25 import org.netbeans.modules.javacore.parser.TypeRef; 26 27 32 public abstract class FieldClassImpl extends SemiPersistentClass implements FieldClass { 33 34 protected FieldClassImpl(StorableClass s) { 35 super(s); 36 } 37 38 42 public Field createField() { 43 return create(null, null, false, null, 0, null, null, 0, null, null); 44 } 45 46 59 public Field createField(java.lang.String name, java.util.List annotations, int modifiers, java.lang.String javadocText, org.netbeans.jmi.javamodel.JavaDoc javadoc, boolean isFinal, org.netbeans.jmi.javamodel.TypeReference typeName, int dimCount, org.netbeans.jmi.javamodel.InitialValue initialValue, java.lang.String initialValueText) { 60 return create(name, annotations, isFinal, typeName, dimCount, initialValue, initialValueText, modifiers, javadocText, javadoc); 61 } 62 63 private Field create(java.lang.String name, java.util.List annotations, boolean isFinal, TypeReference typeName, int dimCount, org.netbeans.jmi.javamodel.InitialValue initialValue, java.lang.String initialValueText, int modifiers, java.lang.String javadocText, org.netbeans.jmi.javamodel.JavaDoc javadoc) { 64 FieldImpl result = create(name, modifiers, null, false); 65 result.setNew(); 66 result.setData(annotations, modifiers, javadocText, javadoc, isFinal, typeName, dimCount, initialValue, initialValueText); 67 return result; 68 } 69 70 public FieldImpl create(String name, int modifiers, TypeRef type, boolean isTransient) { 71 FieldImpl result; 72 if (isTransient) { 73 result = (FieldImpl) 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 = (FieldImpl) super_createField(name, null, modifiers, null, null, false, null, 0, null, null); 84 } 85 result.setTypeRef(type); 86 return result; 87 } 88 89 protected abstract Field super_createField(); 90 protected abstract Field super_createField(java.lang.String name, java.util.List annotations, int modifiers, java.lang.String javadocText, org.netbeans.jmi.javamodel.JavaDoc javadoc, boolean isFinal, org.netbeans.jmi.javamodel.TypeReference typeName, int dimCount, org.netbeans.jmi.javamodel.InitialValue initialValue, java.lang.String initialValueText); 91 } 92 | Popular Tags |