Package com.github.dynamicextensionsalfresco.actions.annotations

Examples of com.github.dynamicextensionsalfresco.actions.annotations.ActionParam


          }
        }
      }
      for (final Annotation parameterAnnotation : parameterAnnotations[index]) {
        if (parameterAnnotation instanceof ActionParam) {
          final ActionParam actionParameter = (ActionParam) parameterAnnotation;
          String name = actionParameter.value();
          if (StringUtils.isEmpty(name)) {
            name = methodParameterNames[index];
          }
          if (StringUtils.isEmpty(name)) {
            throw new RuntimeException(
                String.format(
                    "Cannot determine name of parameter at index %s of method %s."
                        + " No name specified in @RequestParam annotation and no name available in debug info.",
                    index, method));
          }
          final DataTypeDefinition dataType = getDataType(clazz, actionParameter);
          if (dataType == null) {
            throw new RuntimeException(
                String.format("Cannot map parameter of type %s for action method %s."
                    + " Make sure you specify a valid DataType from the Dictionary.", clazz, method));
          }
          final boolean mandatory = actionParameter.mandatory();
          final String displayLabel = actionParameter.displayLabel();
          final String constraintName = StringUtils.stripToNull(actionParameter.constraintName());
          final ParameterDefinition parameterDefinition = new ParameterDefinitionImpl(name,
              dataType.getName(), mandatory, displayLabel, multivalued, constraintName);
          parameterDefinitions.add(parameterDefinition);
          final String parameterName = parameterDefinition.getName();
          if (mapping.hasParameter(parameterName) == false) {
View Full Code Here

TOP

Related Classes of com.github.dynamicextensionsalfresco.actions.annotations.ActionParam

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.