Skip to content
Permalink
Browse files

Improved: Remove unneeded code in ‘entity’ component

(OFBIZ-10777)
Thanks Mathieu Lirzin for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850802 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
gilPts committed Jan 8, 2019
1 parent f30cf03 commit 9b10f939484ffccb4041647db08bc733d3d012d3
@@ -407,17 +407,6 @@
*/
ModelFieldType getEntityFieldType(ModelEntity entity, String type) throws GenericEntityException;

/**
* Gets field type names from the helper that corresponds to the specified
* entity
*
* @param entity
* The entity
* @return Collection of field type names from the helper that corresponds
* to the specified entity
*/
Collection<String> getEntityFieldTypeNames(ModelEntity entity) throws GenericEntityException;

/**
* Gets the helper name that corresponds to this delegator and the specified
* entityName
@@ -573,24 +573,6 @@ public ModelFieldTypeReader getModelFieldTypeReader(ModelEntity entity) {
return modelFieldTypeReader;
}

/* (non-Javadoc)
* @see org.apache.ofbiz.entity.Delegator#getEntityFieldTypeNames(org.apache.ofbiz.entity.model.ModelEntity)
*/
@Override
public Collection<String> getEntityFieldTypeNames(ModelEntity entity) throws GenericEntityException {
String helperName = getEntityHelperName(entity);

if (UtilValidate.isEmpty(helperName)) {
return null;
}
ModelFieldTypeReader modelFieldTypeReader = ModelFieldTypeReader.getModelFieldTypeReader(helperName);

if (modelFieldTypeReader == null) {
throw new GenericEntityException("ModelFieldTypeReader not found for entity " + entity.getEntityName() + " with helper name " + helperName);
}
return modelFieldTypeReader.getFieldTypeNames();
}

/* (non-Javadoc)
* @see org.apache.ofbiz.entity.Delegator#makeValue(java.lang.String)
*/
@@ -19,7 +19,6 @@
package org.apache.ofbiz.entity.model;

import java.io.Serializable;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -105,20 +104,6 @@ public ModelFieldTypeReader(Map<String, ModelFieldType> fieldTypeMap) {
this.fieldTypeCache = fieldTypeMap;
}

/** Creates a Collection with all of the ModelFieldType names
* @return A Collection of ModelFieldType names
*/
public Collection<String> getFieldTypeNames() {
return this.fieldTypeCache.keySet();
}

/** Creates a Collection with all of the ModelFieldTypes
* @return A Collection of ModelFieldTypes
*/
public Collection<ModelFieldType> getFieldTypes() {
return this.fieldTypeCache.values();
}

/** Gets an FieldType object based on a definition from the specified XML FieldType descriptor file.
* @param fieldTypeName The fieldTypeName of the FieldType definition to use.
* @return An FieldType object describing the specified fieldType of the specified descriptor file.

0 comments on commit 9b10f93

Please sign in to comment.
You can’t perform that action at this time.