1 4 package com.nightlabs.ipanema.store; 5 6 import java.io.Serializable ; 7 8 import com.nightlabs.inheritance.FieldMetaData; 9 import com.nightlabs.inheritance.NotWritableException; 10 11 20 public class MapEntryMetaData 21 implements com.nightlabs.inheritance.MapEntryMetaData, Serializable 22 { 23 27 private String fieldName; 28 29 33 private String key; 34 35 40 private byte writableByChildren = FieldMetaData.WRITABLEBYCHILDREN_YES; 41 42 48 private boolean writable = true; 49 50 56 private boolean valueInherited = true; 57 58 61 private MapFieldMetaData mapFieldMetaData; 62 63 protected MapEntryMetaData() { } 64 public MapEntryMetaData(MapFieldMetaData mapFieldMetaData, String key) 65 { 66 this.mapFieldMetaData = mapFieldMetaData; 67 this.fieldName = mapFieldMetaData.getFieldName(); 68 this.key = key; 69 } 70 71 74 public String getFieldName() 75 { 76 return fieldName; 77 } 78 79 82 public Object getKey() 83 { 84 return key; 85 } 86 87 90 public byte getWritableByChildren() 91 { 92 return writableByChildren; 93 } 94 95 98 public void setWritableByChildren(byte writableByChildren) 99 { 100 this.writableByChildren = writableByChildren; 101 } 102 103 106 public boolean isWritable() 107 { 108 return writable; 109 } 110 111 114 public void assertWritable() throws NotWritableException 115 { 116 if (!isWritable()) 117 throw new NotWritableException("Field \""+getFieldName()+"\" is not writeable!"); 118 } 119 120 123 public void setWritable(boolean writable) 124 { 125 this.writable = writable; 126 } 127 128 131 public boolean isValueInherited() 132 { 133 return valueInherited; 134 } 135 136 139 public void setValueInherited(boolean valueInherited) 140 { 141 this.valueInherited = valueInherited; 142 } 143 144 } 145 | Popular Tags |