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
This commit is contained in:
@@ -407,17 +407,6 @@ public interface Delegator {
|
||||
*/
|
||||
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 class GenericDelegator implements Delegator {
|
||||
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)
|
||||
*/
|
||||
|
||||
-15
@@ -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 class ModelFieldTypeReader implements Serializable {
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user