Package org.eclipse.orion.server.core.resources.annotations

Examples of org.eclipse.orion.server.core.resources.annotations.PropertyDescription


    JSONObject result = new JSONObject();
    try {
      for (Property property : resourceShape.getProperties()) {
        Method getter = ReflectionHelper.findGetterForPropertyName(resource.getClass(), property.getName());
        Object value = ReflectionHelper.callGetter(resource, getter);
        PropertyDescription propertyDescriptionAnnotation = ReflectionHelper.getAnnotation(getter, PropertyDescription.class);
        if (propertyDescriptionAnnotation.expandable()) {
          ResourceShape nestedResourceShape = property.getResourceShape();
          Assert.isNotNull(nestedResourceShape, "Could not find resource shape definition for: " + property.getName()); //$NON-NLS-1$
          result.put(property.getName(), serialize(value, nestedResourceShape));
        } else {
          result.put(property.getName(), value);
View Full Code Here


      for (Method method : currentResourceClass.getDeclaredMethods()) {
        if (method.getParameterTypes().length == 0) {
          String methodName = method.getName();
          int methodNameLength = methodName.length();
          if (((methodName.startsWith(METHOD_NAME_GET)) && (methodNameLength > METHOD_NAME_GET.length())) || ((methodName.startsWith(METHOD_NAME_IS)) && (methodNameLength > METHOD_NAME_IS.length()))) {
            PropertyDescription propertyDescriptionAnnotation = ReflectionHelper.getAnnotation(method, PropertyDescription.class);
            if (propertyDescriptionAnnotation != null) {
              String propertyDescriptionName = propertyDescriptionAnnotation.name();
              if (propertyName.equals(propertyDescriptionName)) {
                return method;
              }
            }
          }
View Full Code Here

TOP

Related Classes of org.eclipse.orion.server.core.resources.annotations.PropertyDescription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.