Examples of TextHandler


Examples of org.dmlite.util.text.TextHandler

   */
  private void fill(Document document) throws DmException {
    try {
      String conceptCode = entities.getConceptConfig().getCode();
      String conceptsCode = entities.getConceptConfig().getEntitiesCode();
      TextHandler textHandler = new TextHandler();
      String smallLetterConceptCode = textHandler
          .firstLetterToLower(conceptCode);
      String smallLetterConceptsCode = textHandler
          .firstLetterToLower(conceptsCode);
      Element root = document.addElement(smallLetterConceptsCode);
      fill(root, smallLetterConceptCode);
    } catch (Exception e) {
      log.error("=== Problem with XmlEntities.fill: " + " === "
View Full Code Here

Examples of org.dmlite.util.text.TextHandler

    Collection<ConceptConfig> c = this.getCollection();
    log.info("*** " + title + " ***");
    for (IEntity config : c) {
      ConceptConfig conceptConfig = (ConceptConfig) config;
      String className = conceptConfig.getClass().getName();
      TextHandler textExtractor = new TextHandler();
      String classSimpleName = textExtractor
          .extractClassSimpleName(className);
      conceptConfig.output(classSimpleName);
    }
  }
View Full Code Here

Examples of org.dmlite.util.text.TextHandler

          }
        } else if (propertyClass == String.class) {
          propertyValueText = (String) entity
              .getProperty(propertyCode);
          if (shortContext) {
            TextHandler textHandler = new TextHandler();
            propertyValueText = textHandler.extractBeginPlusThreeDots(
                propertyValueText, App.SHORT_TEXT_LENGTH);
          }
          if (propertyConfig.isScramble()) {
            propertyValueText = "********";
          }
 
View Full Code Here

Examples of org.dmlite.util.text.TextHandler

   */
  public String getPropertyClassSimpleName() {
    String propertyClassSimpleName = null;
    String propertyClass = getPropertyClass();
    if (propertyClass != null) {
      TextHandler textExtractor = new TextHandler();
      propertyClassSimpleName = textExtractor
          .extractClassSimpleName(propertyClass);
    }
    return propertyClassSimpleName;
  }
View Full Code Here

Examples of org.dmlite.util.text.TextHandler

      String emailConfigFilePath = createEmailConfigAbsolutePath();
      EmailsConfig emailsConfig = new EmailsConfig(emailConfigFilePath);

      EmailConfig emailConfig = emailsConfig.getFirstEmailConfig();
      TextHandler textExtractor = new TextHandler();
      String classSimpleName = textExtractor
          .extractClassSimpleName(emailConfig.getClass().getName());
      emailConfig.output(classSimpleName);
      // emailConfig.output(emailConfig.getClass().getSimpleName()); //
      // 1.5
View Full Code Here

Examples of org.dmlite.util.text.TextHandler

    setClassBase(claz);
    String classLastDirPath = getClassBasedPath("");
    // log.info("Class Last Dir Path: " + classLastDirPath);

    TextHandler textExtractor = new TextHandler();
    String classPackageNameWithSlashes = textExtractor
        .extractClassPackageNameWithSlashes(claz.getName());
    // log.info("Class Package Name With Slashes: " +
    // classPackageNameWithSlashes);
    String classPackagePath = textExtractor.dropEnd(classLastDirPath,
        classPackageNameWithSlashes);
    // log.info("Class Package Path: " + classPackagePath);
    String classParentDirPath = textExtractor.dropEnd(classPackagePath,
        parentRelativePath);
    // log.info("Class Parent Dir Path: " + classParentDirPath);

    path = classParentDirPath + endPath;
    return path;
View Full Code Here

Examples of org.dmlite.util.text.TextHandler

        args[0] = paramValue;
        Object object = null; // static method only
        returnObject = method.invoke(object, args);
        // errors.add("Method name: " + method.getName());
      } catch (InvocationTargetException e) {
        TextHandler textExtractor = new TextHandler();
        errors.add("Method " + methodName + " cannot be invoked: "
            + e.getMessage());
        String classSimpleName = textExtractor
            .extractClassSimpleName(claz.getName());
        errors.add("Object class: " + classSimpleName);
        // errors.add("Object class: " + clas.getSimpleName()); // 1.5
        errors.add("Method name: " + method.getName());
        String paramClassSimpleName = textExtractor
            .extractClassSimpleName(paramClass.getName());
        errors.add("Param class: " + paramClassSimpleName);
        // errors.add("Param class: " + paramClass.getSimpleName()); //
        // 1.5
        errors.add("Param: " + paramValue);
View Full Code Here

Examples of org.dmlite.util.text.TextHandler

        Object[] args = new Object[1];
        args[0] = paramValue;
        returnObject = method.invoke(object, args);
        // errors.add("Method name: " + method.getName());
      } catch (InvocationTargetException e) {
        TextHandler textExtractor = new TextHandler();
        errors.add("Method " + methodName + " cannot be invoked: "
            + e.getMessage());
        String classSimpleName = textExtractor
            .extractClassSimpleName(clas.getName());
        errors.add("Object class: " + classSimpleName);
        // errors.add("Object class: " + clas.getSimpleName()); // 1.5
        errors.add("Object: " + object);
        errors.add("Method name: " + method.getName());
        String paramClassSimpleName = textExtractor
            .extractClassSimpleName(paramClass.getName());
        errors.add("Param class: " + paramClassSimpleName);
        // errors.add("Param class: " + paramClass.getSimpleName()); //
        // 1.5
        errors.add("Param: " + paramValue);
View Full Code Here

Examples of org.dmlite.util.text.TextHandler

    Collection<PropertyConfig> c = this.getCollection();
    log.info("*** " + title + " ***");
    for (IEntity config : c) {
      PropertyConfig propertyConfig = (PropertyConfig) config;
      String className = propertyConfig.getClass().getName();
      TextHandler textExtractor = new TextHandler();
      String classSimpleName = textExtractor
          .extractClassSimpleName(className);
      propertyConfig.output(classSimpleName);
    }
  }
View Full Code Here

Examples of org.dmlite.util.text.TextHandler

            "displayText");
      }

      Class propertyClass = propertyConfig.getPropertyClassObject();
      String propertyCode = propertyConfig.getCode();
      TextHandler textExtractor = new TextHandler();
      Object property = entity.getProperty(propertyCode);
      String link;
      String linkDisplayText;
      if (entity != null) {
        if (propertyClass == URL.class) {
          URL url = (URL) property;
          if (url == null) {
            link = "";
          } else {
            link = url.toString();
          }
          if (displayText == null) {
            linkDisplayText = textExtractor
                .extractBeginPlusThreeDots(link,
                    App.SHORT_TEXT_LENGTH);
          } else {
            linkDisplayText = displayText;
          }
          externalLink = new ExternalLink("propertyValue", link,
              linkDisplayText);
          add(externalLink);
        } else if (propertyClass == Email.class) {
          Email email = (Email) property;
          if (email == null) {
            link = "";
          } else {
            link = email.toString();
          }
          if (displayText == null) {
            linkDisplayText = textExtractor
                .extractBeginPlusThreeDots(link,
                    App.SHORT_TEXT_LENGTH);
          } else {
            linkDisplayText = displayText;
          }
          externalLink = new ExternalLink("propertyValue", "mailto: " + link,
              linkDisplayText);
          add(externalLink);
        } else if (propertyClass == String.class) {
          link = (String) property;
          if (link == null) {
            link = "";
          }
          if (propertyConfig.getValidationType()
              .equals("java.net.URL")) {
            if (displayText == null) {
              linkDisplayText = textExtractor
                  .extractBeginPlusThreeDots(link,
                      App.SHORT_TEXT_LENGTH);
            } else {
              linkDisplayText = displayText;
            }
            externalLink = new ExternalLink("propertyValue", link,
                linkDisplayText);
            add(externalLink);
          } else if (propertyConfig.getValidationType().equals(
              "org.dmlite.type.email.Email")) {
            if (displayText == null) {
              linkDisplayText = textExtractor
                  .extractBeginPlusThreeDots(link,
                      App.SHORT_TEXT_LENGTH);
            } else {
              linkDisplayText = displayText;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.