info.simongibbs.scoof
Class Passage

java.lang.Object
  extended byinfo.simongibbs.scoof.Specifier
      extended byinfo.simongibbs.scoof.Passage
All Implemented Interfaces:
java.lang.Comparable

public class Passage
extends Specifier

Represents a bit of code and its origin.

Version:
$Revision: 1.7 $
Author:
Simon Gibbs

Constructor Summary
Passage(java.lang.String code, int line)
          Constructor for Passage.
 
Method Summary
 void foldToLowerCase()
          STandARDise tO lowercase.
 void foldToUpperCase()
          STandARDise tO UPPER CASE.
 java.lang.String getCode()
          Returns the code, which will have been treated.
static void main(java.lang.String[] args)
           
 void mergeLines()
          Merge lines from multiline comments, includes removal of asterisks.
 void normaliseLines()
          Removes multiple blank lines and strips whitespace from the begining and ends of lines.
 void setCode(java.lang.String code)
          Supply fresh untreated code.
 void squashWhitespace()
          Renders code as one line, with whitespace standardised to single spaces.
 void squashWhitespace(java.lang.String delim)
          Standardises whitespace to singles spaces using supplied set of delimiters.
 java.lang.String toString()
          Produces CSV style output using treated code.
static java.lang.String xmlEntityEncode(java.lang.String raw)
          Handles conversion of a raw string into an XML compatible string by replacing minimum special characters with XML entities.
 
Methods inherited from class info.simongibbs.scoof.Specifier
compareTo, getGenerator, getLine, getOriginalLength, getSource, setGenerator, setLine, setOriginalLength, setSource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Passage

public Passage(java.lang.String code,
               int line)
Constructor for Passage.

Method Detail

getCode

public java.lang.String getCode()
Returns the code, which will have been treated.

Returns:
String

setCode

public void setCode(java.lang.String code)
Supply fresh untreated code.

Parameters:
code - The code to set

foldToUpperCase

public void foldToUpperCase()
STandARDise tO UPPER CASE.


foldToLowerCase

public void foldToLowerCase()
STandARDise tO lowercase.


mergeLines

public void mergeLines()
Merge lines from multiline comments, includes removal of asterisks. Trims whitespace.


squashWhitespace

public void squashWhitespace(java.lang.String delim)
Standardises whitespace to singles spaces using supplied set of delimiters. The delimiter set define what whitespace IS for the purposes of this method.


squashWhitespace

public void squashWhitespace()
Renders code as one line, with whitespace standardised to single spaces.


normaliseLines

public void normaliseLines()
Removes multiple blank lines and strips whitespace from the begining and ends of lines.


toString

public java.lang.String toString()
Produces CSV style output using treated code.

See Also:
Object.toString()

xmlEntityEncode

public static java.lang.String xmlEntityEncode(java.lang.String raw)
Handles conversion of a raw string into an XML compatible string by replacing minimum special characters with XML entities. Why can't I find a standard implementation of this? Conolly, Dan (1997) XML: Principles, Tools, and Techniques, O'Reilly, pages 49-50

Parameters:
raw -
Returns:
translated String

main

public static void main(java.lang.String[] args)