Package ch.ralscha.extdirectspring.bean.api

Examples of ch.ralscha.extdirectspring.bean.api.ActionDoc


   * @param documentation
   * @return ActionDoc
   */
  private Action extractDocumentationAnnotations(ExtDirectMethodDocumentation documentation) {
    if (!documentation.value().isEmpty()) {
      ActionDoc actionDoc = new ActionDoc(getAction(), documentation.value(), documentation.author(),
          documentation.version(), documentation.deprecated());
      ExtDirectDocParameters docParameters = documentation.parameters();
      if (null != docParameters) {
        String[] params = docParameters.params();
        String[] descriptions = docParameters.descriptions() == null ? new String[params.length]
            : docParameters.descriptions();
        if (params.length == descriptions.length) {
          for (int i = 0; i < params.length; i++) {
            actionDoc.getParameters().put(params[i],
                descriptions[i] == null ? "No description" : descriptions[i]);
          }
        } else {
          LogFactory
              .getLog(MethodInfo.class)
              .info("Documentation: skip generation of parameters, params size is different from descriptions size");
        }
      }
      ExtDirectDocReturn docReturn = documentation.returnMethod();
      if (null != docReturn) {
        String[] properties = docReturn.properties();
        String[] descriptions = docReturn.descriptions() == null ? new String[properties.length] : docReturn
            .descriptions();
        if (properties.length == descriptions.length) {
          for (int i = 0; i < properties.length; i++) {
            actionDoc.getReturnMethod().put(properties[i],
                descriptions[i] == null ? "No description" : descriptions[i]);
          }
        } else {
          LogFactory
              .getLog(MethodInfo.class)
View Full Code Here


          // mode
          if (jgen.getPrettyPrinter() != null && action instanceof ActionDoc) {// insertion
                                              // of
                                              // doc
                                              // here
            ActionDoc actionDoc = (ActionDoc) action;
            jgen.writeRaw("\n\t/**");
            if (actionDoc.isDeprecated()) {
              jgen.writeRaw("\n\t* @deprecated");
            }
            jgen.writeRaw("\n\t* " + actionDoc.getName() + ": " + actionDoc.getMethodComment());
            jgen.writeRaw("\n\t* @author: " + actionDoc.getAuthor());
            jgen.writeRaw("\n\t* @version: " + actionDoc.getVersion());
            jgen.writeRaw("\n\t*");
            for (Entry<String, String> entry2 : actionDoc.getParameters().entrySet()) {
              jgen.writeRaw("\n\t* @param: [" + entry2.getKey() + "] " + entry2.getValue());
            }
            jgen.writeRaw("\n\t* @return");
            for (Entry<String, String> entry2 : actionDoc.getReturnMethod().entrySet()) {
              jgen.writeRaw("\n\t*\t [" + entry2.getKey() + "] " + entry2.getValue());
            }
            jgen.writeRaw("\n\t*/\n");
          }
          jgen.writeObject(action);
 
View Full Code Here

   * @param documentation
   * @return ActionDoc
   */
  private Action extractDocumentationAnnotations(ExtDirectMethodDocumentation documentation) {
    if (!documentation.value().isEmpty()) {
      ActionDoc actionDoc = new ActionDoc(getAction(), documentation.value(), documentation.author(),
          documentation.version(), documentation.deprecated());
      ExtDirectDocParameters docParameters = documentation.parameters();
      if (null != docParameters) {
        String[] params = docParameters.params();
        String[] descriptions = docParameters.descriptions() == null ? new String[params.length]
            : docParameters.descriptions();
        if (params.length == descriptions.length) {
          for (int i = 0; i < params.length; i++) {
            actionDoc.getParameters().put(params[i],
                descriptions[i] == null ? "No description" : descriptions[i]);
          }
        } else {
          LogFactory
              .getLog(MethodInfo.class)
              .info("Documentation: skip generation of parameters, params size is different from descriptions size");
        }
      }
      ExtDirectDocReturn docReturn = documentation.returnMethod();
      if (null != docReturn) {
        String[] properties = docReturn.properties();
        String[] descriptions = docReturn.descriptions() == null ? new String[properties.length] : docReturn
            .descriptions();
        if (properties.length == descriptions.length) {
          for (int i = 0; i < properties.length; i++) {
            actionDoc.getReturnMethod().put(properties[i],
                descriptions[i] == null ? "No description" : descriptions[i]);
          }
        } else {
          LogFactory
              .getLog(MethodInfo.class)
View Full Code Here

          // mode
          if (jgen.getPrettyPrinter() != null && action instanceof ActionDoc) {// insertion
            // of
            // doc
            // here
            ActionDoc actionDoc = (ActionDoc) action;
            jgen.writeRaw("\n\t/**");
            if (actionDoc.isDeprecated()) {
              jgen.writeRaw("\n\t* @deprecated");
            }
            jgen.writeRaw("\n\t* " + actionDoc.getName() + ": "
                + actionDoc.getMethodComment());
            jgen.writeRaw("\n\t* @author: " + actionDoc.getAuthor());
            jgen.writeRaw("\n\t* @version: " + actionDoc.getVersion());
            jgen.writeRaw("\n\t*");
            for (Entry<String, String> entry2 : actionDoc.getParameters()
                .entrySet()) {
              jgen.writeRaw("\n\t* @param: [" + entry2.getKey() + "] "
                  + entry2.getValue());
            }
            jgen.writeRaw("\n\t* @return");
            for (Entry<String, String> entry2 : actionDoc.getReturnMethod()
                .entrySet()) {
              jgen.writeRaw("\n\t*\t [" + entry2.getKey() + "] "
                  + entry2.getValue());
            }
            jgen.writeRaw("\n\t*/\n");
 
View Full Code Here

   * @return ActionDoc
   */
  private Action extractDocumentationAnnotations(
      ExtDirectMethodDocumentation documentation) {
    if (!documentation.value().isEmpty()) {
      ActionDoc actionDoc = new ActionDoc(getAction(), documentation.value(),
          documentation.author(), documentation.version(),
          documentation.deprecated());
      ExtDirectDocParameters docParameters = documentation.parameters();
      if (null != docParameters) {
        String[] params = docParameters.params();
        String[] descriptions = docParameters.descriptions() == null ? new String[params.length]
            : docParameters.descriptions();
        if (params.length == descriptions.length) {
          for (int i = 0; i < params.length; i++) {
            actionDoc.getParameters().put(
                params[i],
                descriptions[i] == null ? "No description"
                    : descriptions[i]);
          }
        }
        else {
          LogFactory
              .getLog(MethodInfo.class)
              .info("Documentation: skip generation of parameters, params size is different from descriptions size");
        }
      }
      ExtDirectDocReturn docReturn = documentation.returnMethod();
      if (null != docReturn) {
        String[] properties = docReturn.properties();
        String[] descriptions = docReturn.descriptions() == null ? new String[properties.length]
            : docReturn.descriptions();
        if (properties.length == descriptions.length) {
          for (int i = 0; i < properties.length; i++) {
            actionDoc.getReturnMethod().put(
                properties[i],
                descriptions[i] == null ? "No description"
                    : descriptions[i]);
          }
        }
View Full Code Here

          // mode
          if (jgen.getPrettyPrinter() != null && action instanceof ActionDoc) {// insertion
                                              // of
                                              // doc
                                              // here
            ActionDoc actionDoc = (ActionDoc) action;
            jgen.writeRaw("\n\t/**");
            if (actionDoc.isDeprecated()) {
              jgen.writeRaw("\n\t* @deprecated");
            }
            jgen.writeRaw("\n\t* " + actionDoc.getName() + ": " + actionDoc.getMethodComment());
            jgen.writeRaw("\n\t* @author: " + actionDoc.getAuthor());
            jgen.writeRaw("\n\t* @version: " + actionDoc.getVersion());
            jgen.writeRaw("\n\t*");
            for (Entry<String, String> entry2 : actionDoc.getParameters().entrySet()) {
              jgen.writeRaw("\n\t* @param: [" + entry2.getKey() + "] " + entry2.getValue());
            }
            jgen.writeRaw("\n\t* @return");
            for (Entry<String, String> entry2 : actionDoc.getReturnMethod().entrySet()) {
              jgen.writeRaw("\n\t*\t [" + entry2.getKey() + "] " + entry2.getValue());
            }
            jgen.writeRaw("\n\t*/\n");
          }
          jgen.writeObject(action);
 
View Full Code Here

   * @param documentation
   * @return ActionDoc
   */
  private Action extractDocumentationAnnotations(ExtDirectMethodDocumentation documentation) {
    if (!documentation.value().isEmpty()) {
      ActionDoc actionDoc = new ActionDoc(getAction(), documentation.value(), documentation.author(),
          documentation.version(), documentation.deprecated());
      ExtDirectDocParameters docParameters = documentation.parameters();
      if (null != docParameters) {
        String[] params = docParameters.params();
        String[] descriptions = docParameters.descriptions() == null ? new String[params.length]
            : docParameters.descriptions();
        if (params.length == descriptions.length) {
          for (int i = 0; i < params.length; i++) {
            actionDoc.getParameters().put(params[i],
                descriptions[i] == null ? "No description" : descriptions[i]);
          }
        } else {
          LogFactory
              .getLog(MethodInfo.class)
              .info("Documentation: skip generation of parameters, params size is different from descriptions size");
        }
      }
      ExtDirectDocReturn docReturn = documentation.returnMethod();
      if (null != docReturn) {
        String[] properties = docReturn.properties();
        String[] descriptions = docReturn.descriptions() == null ? new String[properties.length] : docReturn
            .descriptions();
        if (properties.length == descriptions.length) {
          for (int i = 0; i < properties.length; i++) {
            actionDoc.getReturnMethod().put(properties[i],
                descriptions[i] == null ? "No description" : descriptions[i]);
          }
        } else {
          LogFactory
              .getLog(MethodInfo.class)
View Full Code Here

TOP

Related Classes of ch.ralscha.extdirectspring.bean.api.ActionDoc

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.