removed method and type from features

revert-70aa11f8
ayyoob 9 years ago
parent 42dde2c8eb
commit ec7727e8bf

@ -28,8 +28,6 @@ public class Feature implements Serializable {
private String name; private String name;
private String description; private String description;
private String deviceType; private String deviceType;
private String method;
private String type;
private List<MetadataEntry> metadataEntries; private List<MetadataEntry> metadataEntries;
@XmlElement @XmlElement
@ -85,24 +83,6 @@ public class Feature implements Serializable {
this.description = description; this.description = description;
} }
@XmlElement
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@XmlElement
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public static class MetadataEntry implements Serializable { public static class MetadataEntry implements Serializable {
private int id; private int id;

@ -147,7 +147,8 @@ public class AnnotationUtil {
Map<String, Object> apiParams = new HashMap<>(); Map<String, Object> apiParams = new HashMap<>();
for (int i = 0; i < annotations.length; i++) { for (int i = 0; i < annotations.length; i++) {
Annotation currentAnnotation = annotations[i]; Annotation currentAnnotation = annotations[i];
feature = processHttpMethodAnnotation(feature, currentAnnotation); String method = processHttpMethodAnnotation(feature, currentAnnotation);
apiParams.put("method", method);
if (currentAnnotation.annotationType().getName().equals(Path.class.getName())) { if (currentAnnotation.annotationType().getName().equals(Path.class.getName())) {
String uri = getPathAnnotationValue(currentMethod); String uri = getPathAnnotationValue(currentMethod);
apiParams.put("uri", uri); apiParams.put("uri", uri);
@ -203,20 +204,21 @@ public class AnnotationUtil {
* @param currentAnnotation * @param currentAnnotation
* @return * @return
*/ */
private Feature processHttpMethodAnnotation(Feature feature, Annotation currentAnnotation) { private String processHttpMethodAnnotation(Feature feature, Annotation currentAnnotation) {
//Extracting method with which feature is exposed //Extracting method with which feature is exposed
String method = null;
if (currentAnnotation.annotationType().getName().equals(GET.class.getName())) { if (currentAnnotation.annotationType().getName().equals(GET.class.getName())) {
feature.setMethod(HttpMethod.GET); method = HttpMethod.GET;
} else if (currentAnnotation.annotationType().getName().equals(POST.class.getName())) { } else if (currentAnnotation.annotationType().getName().equals(POST.class.getName())) {
feature.setMethod(HttpMethod.POST); method = HttpMethod.POST;
} else if (currentAnnotation.annotationType().getName().equals(OPTIONS.class.getName())) { } else if (currentAnnotation.annotationType().getName().equals(OPTIONS.class.getName())) {
feature.setMethod(HttpMethod.OPTIONS); method = HttpMethod.OPTIONS;
} else if (currentAnnotation.annotationType().getName().equals(DELETE.class.getName())) { } else if (currentAnnotation.annotationType().getName().equals(DELETE.class.getName())) {
feature.setMethod(HttpMethod.DELETE); method = HttpMethod.DELETE;
} else if (currentAnnotation.annotationType().getName().equals(PUT.class.getName())) { } else if (currentAnnotation.annotationType().getName().equals(PUT.class.getName())) {
feature.setMethod(HttpMethod.PUT); method = HttpMethod.PUT;
} }
return feature; return method;
} }
/** /**
@ -240,9 +242,6 @@ public class AnnotationUtil {
case "description": case "description":
feature.setDescription(invokeMethod(featureAnnoMethods[k], featureAnno, STRING)); feature.setDescription(invokeMethod(featureAnnoMethods[k], featureAnno, STRING));
break; break;
case "type":
feature.setType(invokeMethod(featureAnnoMethods[k], featureAnno, STRING));
break;
} }
} }
return feature; return feature;

Loading…
Cancel
Save