Package org.alfresco.service.cmr.dictionary

Examples of org.alfresco.service.cmr.dictionary.DataTypeDefinition


                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) {
            mapping.addParameterMapping(new ParameterMapping(parameterDefinition, index, clazz));
          } else {
View Full Code Here


    }
    return mapping;
  }

  private DataTypeDefinition getDataType(final Class<?> clazz, final ActionParam actionParameter) {
    final DataTypeDefinition dataType;
    if (StringUtils.isNotEmpty(actionParameter.type())) {
      dataType = getDictionaryService().getDataType(parseQName(actionParameter.type(), actionParameter));
      if (dataType == null) {
        throw new RuntimeException(String.format("Invalid or unknown DataType: %s", actionParameter.type()));
      }
View Full Code Here

TOP

Related Classes of org.alfresco.service.cmr.dictionary.DataTypeDefinition

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.