Initialization to be done after constructor assignments, such as setting of the all-important DDFManager.
(DDFManager manager, Object data, Class<?>[]
typeSpecs, String namespace, String name,
Schema schema)
| 167 | * Initialization to be done after constructor assignments, such as setting of the all-important DDFManager. |
| 168 | */ |
| 169 | protected void initialize(DDFManager manager, Object data, Class<?>[] |
| 170 | typeSpecs, String namespace, String name, |
| 171 | Schema schema) throws DDFException { |
| 172 | Schema.validateSchema(schema); |
| 173 | this.setManager(manager); // this must be done first in case later stuff needs a manager |
| 174 | |
| 175 | if (typeSpecs != null) { |
| 176 | this.getRepresentationHandler().set(data, typeSpecs); |
| 177 | } |
| 178 | |
| 179 | this.getSchemaHandler().setSchema(schema); |
| 180 | if(schema!= null && schema.getTableName() == null) { |
| 181 | String tableName = this.getSchemaHandler().newTableName(); |
| 182 | schema.setTableName(tableName); |
| 183 | } |
| 184 | |
| 185 | if (Strings.isNullOrEmpty(namespace)) namespace = this.getManager().getNamespace(); |
| 186 | this.setNamespace(namespace); |
| 187 | |
| 188 | manager.setDDFUUID(this, UUID.randomUUID()); |
| 189 | |
| 190 | if(!Strings.isNullOrEmpty(name)) manager.setDDFName(this, name); |
| 191 | |
| 192 | // Facades |
| 193 | this.ML = new MLFacade(this, this.getMLSupporter()); |
| 194 | this.VIEWS = new ViewsFacade(this, this.getViewHandler()); |
| 195 | this.Transform = new TransformFacade(this, this.getTransformationHandler()); |
| 196 | this.R = new RFacade(this, this.getAggregationHandler()); |
| 197 | this.mCreatedTime = new Date(); |
| 198 | } |
| 199 | |
| 200 | /** |
| 201 | * |
no test coverage detected