- Timestamp:
- 07/10/13 22:41:02 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/params/ListAccess.java
r97 r99 5 5 import static com.framsticks.util.lang.Containers.filterInstanceof; 6 6 7 import com.framsticks.params.types.EventParam; 7 8 import com.framsticks.params.types.ProcedureParam; 8 9 … … 13 14 14 15 final AccessInterface elementAccess; 16 final String containedTypeName; 17 18 protected final ParamBuilder paramBuilder; 15 19 16 20 public ListAccess(AccessInterface elementAccess) { 17 21 this.elementAccess = elementAccess; 22 this.containedTypeName = elementAccess.getId(); 23 paramBuilder = elementAccess.buildParam(new ParamBuilder()); 18 24 } 19 25 … … 48 54 49 55 @Override 50 public void copyFrom(AccessInterface src) {51 }52 53 @Override54 56 public void save(SinkInterface sink) { 55 57 for (CompositeParam p : filterInstanceof(getParams(), CompositeParam.class)) { … … 70 72 } 71 73 72 public abstract String computeIdentifierFor(Object selected); 74 /** 75 * @return the containedTypeName 76 */ 77 public String getContainedTypeName() { 78 return containedTypeName; 79 } 73 80 74 81 @Override … … 85 92 @Override 86 93 public Object call(String id, Object[] arguments) { 87 throw new InvalidOperationException().msg("list access does not support calling methods").arg("id", id) ;94 throw new InvalidOperationException().msg("list access does not support calling methods").arg("id", id).arg("access", this); 88 95 } 89 96 90 97 @Override 91 98 public Object call(ProcedureParam param, Object[] arguments) { 92 throw new InvalidOperationException().msg("list access does not support calling methods").arg("param", param) ;99 throw new InvalidOperationException().msg("list access does not support calling methods").arg("param", param).arg("access", this); 93 100 } 94 101 102 @Override 103 public void reg(EventParam param, EventListener<?> listener) { 104 throw new InvalidOperationException().msg("list access does not support registering events").arg("param", param).arg("access", this); 105 } 106 107 @Override 108 public void regRemove(EventParam param, EventListener<?> listener) { 109 throw new InvalidOperationException().msg("list access does not support registering events").arg("param", param).arg("access", this); 110 } 111 112 113 @Override 114 public String toString() { 115 StringBuilder b = new StringBuilder(); 116 b.append("list of ").append(containedTypeName); 117 if (getSelected() != null) { 118 b.append("[").append(getParamCount()).append("]"); 119 } 120 return b.toString(); 121 } 95 122 };
Note: See TracChangeset
for help on using the changeset viewer.