- Timestamp:
- 06/30/13 12:48:20 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/params/FramsClass.java
r87 r88 3 3 import com.framsticks.params.annotations.FramsClassAnnotation; 4 4 import com.framsticks.params.annotations.ParamAnnotation; 5 import com.framsticks.util.FramsticksException; 5 6 // import com.framsticks.util.FramsticksException; 6 7 … … 26 27 @Immutable 27 28 @FramsClassAnnotation(id = "class", name = "class") 28 public finalclass FramsClass {29 public class FramsClass { 29 30 30 31 private final static Logger log = Logger.getLogger(FramsClass.class); … … 54 55 } 55 56 56 public FramsClass( String id, String name, String description, List<Param> params, List<Group> groups) {57 public FramsClass(FramsClassBuilder builder) { 57 58 58 this.id = id;59 this.name = name;60 this.description = description;61 this.groups = groups;62 this.paramList = params;59 this.id = builder.getId(); 60 this.name = builder.getName(); 61 this.description = builder.getDescription(); 62 this.groups = builder.groups; 63 this.paramList = builder.params; 63 64 64 for (Param param : param s) {65 for (Param param : paramList) { 65 66 paramEntryMap.put(param.getId(), param); 66 67 try { … … 133 134 public <T extends Param> T castedParam(@Nonnull final Param param, @Nonnull final Class<T> type, Object name) { 134 135 if (param == null) { 135 return null;136 //throw new FramsticksException().msg("param is missing").arg("name", name).arg("in", this);136 // return null; 137 throw new FramsticksException().msg("param is missing").arg("name", name).arg("in", this); 137 138 } 138 139 if (!type.isInstance(param)) { 139 return null;140 //throw new FramsticksException().msg("wrong type of param").arg("actual", param.getClass()).arg("requested", type).arg("in", this);140 // return null; 141 throw new FramsticksException().msg("wrong type of param").arg("actual", param.getClass()).arg("requested", type).arg("in", this); 141 142 } 142 143 return type.cast(param);
Note: See TracChangeset
for help on using the changeset viewer.