Commits

Michael Ludwig committed 0ca9154

Make init() an abstract method to re-enforce the need for init'ing default values.

Comments (0)

Files changed (10)

src/main/java/com/googlecode/entreri/Component.java

      * </p>
      * @param initParams The initial parameters for the Component
      */
-    protected void init(Object... initParams) throws Exception {
-        // do nothing by default
-    }
+    protected abstract void init(Object... initParams) throws Exception;
     
     /**
      * <p>

src/test/java/com/googlecode/entreri/component/BadConstructorComponent.java

     protected BadConstructorComponent(EntitySystem system, int index, Object extraArgument) {
         super(system, index);
     }
+
+    @Override
+    protected void init(Object... initParams) throws Exception {
+    }
 }

src/test/java/com/googlecode/entreri/component/BadParametersComponent.java

     protected BadParametersComponent(EntitySystem system, int index) {
         super(system, index);
     }
+    
+    @Override
+    protected void init(Object... initParams) throws Exception {
+    }
 }

src/test/java/com/googlecode/entreri/component/ExtraFieldComponent.java

     protected ExtraFieldComponent(EntitySystem system, int index) {
         super(system, index);
     }
+    
+    @Override
+    protected void init(Object... initParams) throws Exception {
+    }
 }

src/test/java/com/googlecode/entreri/component/FloatComponent.java

         int index = getIndex() * 3 + offset;
         property.getIndexedData()[index] = value;
     }
+    
+    @Override
+    protected void init(Object... initParams) throws Exception {
+    }
 }

src/test/java/com/googlecode/entreri/component/IntComponent.java

         int index = getIndex() * 3 + offset;
         property.getIndexedData()[index] = value;
     }
+    
+    @Override
+    protected void init(Object... initParams) throws Exception {
+    }
 }

src/test/java/com/googlecode/entreri/component/MultiPropertyComponent.java

     public NoParameterProperty getCompactProperty() {
         return noparams;
     }
+    
+    @Override
+    protected void init(Object... initParams) throws Exception {
+    }
 }

src/test/java/com/googlecode/entreri/component/ObjectComponent.java

         int index = getIndex() * 3 + offset;
         property.getIndexedData()[index] = value;
     }
+    
+    @Override
+    protected void init(Object... initParams) throws Exception {
+    }
 }

src/test/java/com/googlecode/entreri/component/PublicConstructorComponent.java

     public PublicConstructorComponent(EntitySystem system, int index) {
         super(system, index);
     }
+    
+    @Override
+    protected void init(Object... initParams) throws Exception {
+    }
 }

src/test/java/com/googlecode/entreri/component/PublicPropertyComponent.java

     protected PublicPropertyComponent(EntitySystem system, int index) {
         super(system, index);
     }
+    
+    @Override
+    protected void init(Object... initParams) throws Exception {
+    }
 }