/** * Creates the model description object for the underlying model object. */ public ModelDescription getModelDescription() { String modelName = retrieveModelName(); String modelVersion = retrieveModelVersion(); if (modelName == null || modelVersion == null) { throw new IllegalArgumentException("Unsufficient information to create model description."); } return new ModelDescription(modelName, modelVersion); }
/** * Generates the model description of a field which is annotated with the OpenEngSBForeignKey annotation. */ private ModelDescription getModelDescriptionFromField(Field field) { OpenEngSBForeignKey key = field.getAnnotation(OpenEngSBForeignKey.class); ModelDescription description = new ModelDescription(key.modelType(), key.modelVersion()); return description; }