Exemplo n.º 1
0
 /** {@inheritDoc} */
 @Override
 public Object resolve(
     org.exoplatform.services.rest.Parameter parameter, ApplicationContext context)
     throws Exception {
   String param = this.pathParam.value();
   TypeProducer typeProducer =
       ParameterHelper.createTypeProducer(
           parameter.getParameterClass(), parameter.getGenericType());
   return typeProducer.createValue(
       param, context.getPathParameters(!parameter.isEncoded()), parameter.getDefaultValue());
 }
Exemplo n.º 2
0
 public CCodeGenerator() throws TemplateModelException {
   config.setDefaultEncoding("UTF-8");
   config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
   config.setClassForTemplateLoading(CCodeGenerator.class, "/templates");
   config.setSharedVariable("cTypeHelper", C_TypeHelper.getInstance());
   config.setSharedVariable("enumHelper", EnumHelper.getInstance());
   config.setSharedVariable("requestHelper", RequestHelper.getInstance());
   config.setSharedVariable("helper", Helper.getInstance());
   config.setSharedVariable("structHelper", StructHelper.getInstance());
   config.setSharedVariable("structMemberHelper", StructMemberHelper.getInstance());
   config.setSharedVariable("parameterHelper", ParameterHelper.getInstance());
 }
 public String[] getStringArrayParameter(final String name, final String[] defaultValue) {
   return ParameterHelper.parameterToStringArray(getParameter(name), defaultValue);
 }
 public Object[] getArrayParameter(final String name, final Object[] defaultValue) {
   return ParameterHelper.parameterToObjectArray(getParameter(name), defaultValue);
 }
 public BigDecimal getDecimalParameter(final String name, final BigDecimal defaultValue) {
   return ParameterHelper.parameterToDecimal(
       getStringParameter(name, ""), defaultValue); // $NON-NLS-1$
 }
 public Date getDateParameter(final String name, final Date defaultValue) {
   return ParameterHelper.parameterToDate(getStringParameter(name, null), defaultValue);
 }