Class AbstractSourceRegion

java.lang.Object
org.wurbelizer.wurbel.AbstractSourceRegion
All Implemented Interfaces:
SourceRegion
Direct Known Subclasses:
CoffeeBytesRegion, NetbeansRegion, VisualStudioRegion

public abstract class AbstractSourceRegion extends Object implements SourceRegion
Holds common code for source regions.
  • Field Details

    • GUARD_BEGIN

      public static final String GUARD_BEGIN
      Tag to start a named region.
      Immediately followed by the guarded region's name.
      See Also:
    • GUARD_END

      public static final String GUARD_END
      Tag to end a named region.
      Immediately followed by the guarded region's name.
      See Also:
  • Constructor Details

    • AbstractSourceRegion

      public AbstractSourceRegion()
  • Method Details

    • createCommentGeneratedBy

      protected String createCommentGeneratedBy(String guardName, SourceWurbletSubElement wurbletElement)
      Creates the text for the generated by comment.
      Parameters:
      guardName - the name of the guarded section
      wurbletElement - the wurblet element
      Returns:
      the comment part
    • matches

      protected boolean matches(String comment, String token)
      Checks for the token and assert it's not a region name.
      Parameters:
      comment - the comment string to check
      token - the start- or end-token
      Returns:
      true if token found
    • toString

      public String toString()
      Overrides:
      toString in class Object