Class DirectMethods

java.lang.Object
JHamlConverter.DirectMethods

public class DirectMethods
extends java.lang.Object
  • Constructor Summary

    Constructors
    Constructor Description
    DirectMethods()  
  • Method Summary

    Modifier and Type Method Description
    static java.lang.String[] createTagDetails​(java.lang.String line, int indentation, java.io.FileWriter writer, java.lang.String type)
    Method that creates all the tag details
    static int getChildrenElements​(java.util.ArrayList<java.lang.String> lines, java.lang.String parentTag)
    Method that checks how many 'children' a headParent has
    static int indexOfChar​(java.lang.String line)  
    static java.util.ArrayList<java.lang.String> PopulateList​(java.lang.String filePath)
    Method that Populates lists with the to be converted / used files

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DirectMethods

      public DirectMethods()
  • Method Details

    • PopulateList

      public static java.util.ArrayList<java.lang.String> PopulateList​(java.lang.String filePath) throws java.io.IOException
      Method that Populates lists with the to be converted / used files
      Parameters:
      filePath - - filepath to read a specific document
      Returns:
      newList - Arraylist
      Throws:
      java.io.IOException
    • indexOfChar

      public static int indexOfChar​(java.lang.String line)
      Parameters:
      line - - current to be converted line
      Returns:
      charIndex - integer
    • createTagDetails

      public static java.lang.String[] createTagDetails​(java.lang.String line, int indentation, java.io.FileWriter writer, java.lang.String type) throws java.io.IOException
      Method that creates all the tag details
      Parameters:
      line - - a string where we need to make the correct tag find the ('elements' = rest) and ('value' = txt)
      indentation - - integer value of the indentation of current line
      Returns:
      String[] - String [] with tag rest and txt values
      Throws:
      java.io.IOException
    • getChildrenElements

      public static int getChildrenElements​(java.util.ArrayList<java.lang.String> lines, java.lang.String parentTag)
      Method that checks how many 'children' a headParent has
      Parameters:
      lines - - The to be converted document represented by lines (each index = 1 line (Arraylist))
      parentTag - - current headParent tag
      Returns:
      childrenElements - integer value that gives the exact amount of children of the current headParent