- Timestamp:
- 07/16/13 23:31:35 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/core/LocalTree.java
r101 r102 15 15 import com.framsticks.params.types.ProcedureParam; 16 16 import com.framsticks.util.FramsticksException; 17 import com.framsticks.util.dispatching.Dispatcher; 18 import com.framsticks.util.dispatching.DispatcherSetable; 17 19 import com.framsticks.util.dispatching.Dispatching; 18 20 import com.framsticks.util.dispatching.Future; … … 33 35 public LocalTree() { 34 36 super(); 35 37 bufferedDispatcher.setBuffer(false); 36 38 } 37 39 40 @SuppressWarnings({ "rawtypes", "unchecked" }) 38 41 @AutoAppendAnnotation 39 42 public void setRootObject(Object object) { … … 49 52 joinableRootObject = (Joinable) object; 50 53 } 54 if (object instanceof DispatcherSetable) { 55 DispatcherSetable<?> setable = (DispatcherSetable<?>) object; 56 setable.setDispatcher((Dispatcher) this); 57 } 51 58 } 52 59 53 60 public Object getRootObject() { 54 return getAssignedRoot().getObject(); 61 Object result = getAssignedRoot().getObject(); 62 if (result == null) { 63 throw new FramsticksException().msg("object tree is empty").arg("tree", this); 64 } 65 return result; 55 66 } 56 67 57 68 public <T> T getRootObject(Class<T> type) { 58 69 Object result = getRootObject(); 59 if (result == null) {60 throw new FramsticksException().msg("object tree is empty").arg("tree", this);61 }62 70 if (!type.isInstance(result)) { 63 71 throw new FramsticksException().msg("object tree holds object of different kind").arg("object", result).arg("requested", type).arg("tree", this); … … 181 189 } 182 190 } 191 183 192 }
Note: See TracChangeset
for help on using the changeset viewer.