Package org.dmlite.util.text

Examples of org.dmlite.util.text.TextHandler


  private void loadNeighborChildren(Element element) throws DmException {
    try {
      if (entity.getConceptConfig() != null) {
        NeighborsConfig neighborsConfig = entity.getConceptConfig()
            .getNeighborsConfig();
        TextHandler textHandler = new TextHandler();
        for (IEntity config : neighborsConfig) {
          NeighborConfig neighborConfig = (NeighborConfig) config;
          if (neighborConfig.getType().equals("child")
              && neighborConfig.isInternal()) {
            String neigborProperty = textHandler
                .firstLetterToLower(neighborConfig.getCode());
            Element neighborChildElement = element
                .element(neigborProperty);
            ConceptConfig neighborChildConceptConfig = (ConceptConfig) persistentModel
                .getDomainModel().getModelConfig()
                .getConceptsConfig().retrieveByCode(
                    neighborConfig.getDestination());
            if (neighborChildConceptConfig != null) {
              String neighborChildClassName = neighborChildConceptConfig
                  .getEntitiesClass();
              IDomainModel domainModel = persistentModel
                  .getDomainModel();
              IEntities neighborChildEntities = domainModel
                  .getModelMeta().createEntities(
                      neighborChildClassName);
              String neighborCode = neighborConfig.getCode();
              String setChildMethodName = "set"
                  + textHandler
                      .firstLetterToUpper(neighborCode);
              Reflector.executeMethod(entity, setChildMethodName,
                  neighborChildEntities);
              XmlEntities neighborChildXmlEntities = new XmlEntities(
                  neighborChildEntities, persistentModel);
View Full Code Here


  private void fillPropertyChildren(Element element) throws DmException {
    try {
      if (entity.getConceptConfig() != null) {
        PropertiesConfig propertiesConfig = entity.getConceptConfig()
            .getPropertiesConfig();
        TextHandler textHandler = new TextHandler();
        for (IEntity config : propertiesConfig) {
          PropertyConfig propertyConfig = (PropertyConfig) config;
          String propertyCode = propertyConfig.getCode();
          if (propertyCode.equals("code")) {
            continue;
          }
          String cPropertyCode = textHandler
              .firstLetterToUpper(propertyCode);
          String getMethodName = "get" + cPropertyCode;
          Object getObject = Reflector.executeMethod(entity,
              getMethodName);
          if (getObject != null) {
View Full Code Here

  private void fillNeighborChildren(Element element) throws DmException {
    try {
      if (entity.getConceptConfig() != null) {
        NeighborsConfig neighborsConfig = entity.getConceptConfig()
            .getNeighborsConfig();
        TextHandler textHandler = new TextHandler();
        for (IEntity config : neighborsConfig) {
          NeighborConfig neighborConfig = (NeighborConfig) config;
          if (neighborConfig.getType().equals("child")
              && neighborConfig.isInternal()) {
            String neigborProperty = textHandler
                .firstLetterToLower(neighborConfig.getCode());
            IEntities neighborChildEntities = (IEntities) Reflector
                .getField(entity, neigborProperty);
            if (neighborChildEntities != null) {
              if (!neighborChildEntities.getCollection()
                  .isEmpty()) {
                Element neighborChildElement = element
                    .addElement(neigborProperty);
                XmlEntities neighborChildXmlEntities = new XmlEntities(
                    neighborChildEntities, persistentModel);
                if (neighborChildElement != null) {
                  Object[] params = new Object[2];
                  params[0] = neighborChildElement;
                  params[1] = textHandler
                      .firstLetterToLower(neighborConfig
                          .getDestination());
                  Reflector.executeMethod(
                      neighborChildXmlEntities, "fill",
                      params);
View Full Code Here

   */
  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

    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

          }
        } 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

   */
  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

      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

    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

        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

TOP

Related Classes of org.dmlite.util.text.TextHandler

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.