org.crosswire.common.xml
Class FormatType

java.lang.Object
  extended by org.crosswire.common.xml.FormatType
All Implemented Interfaces:
Serializable

public final class FormatType
extends Object
implements Serializable

The PrettySerializingContentHandler uses a FormatType to control its output.

Distribution Licence:
JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
The copyright to this program is held by it's authors.

Version:
$Id: FormatType.java,v 1.2 2005/03/20 02:34:52 dmsmith Exp $
Author:
DM Smith [dmsmith555 at gmail dot com]
See Also:
Licence, Serialized Form

Field Summary
static FormatType ANALYSIS
           
static FormatType ANALYSIS_INDENT
           
private  boolean analytic
           
static FormatType AS_IS
           
private  boolean classic
           
static FormatType CLASSIC
           
static FormatType CLASSIC_INDENT
           
private  boolean indented
           
private  boolean multiline
           
private  String name
          The name of the FormatType
private static int nextObj
           
private  int obj
           
private static long serialVersionUID
          Serialization ID
private static FormatType[] VALUES
           
 
Constructor Summary
FormatType(String aName, boolean displayNewlines, boolean doIndenting, boolean classicLines)
          Simple ctor
 
Method Summary
 boolean equals(Object o)
          Prevent subclasses from overriding canonical identity based Object methods
static FormatType fromInteger(int i)
          Lookup method to convert from an integer
static FormatType fromString(String name)
          Lookup method to convert from a String
 int hashCode()
          Prevent subclasses from overriding canonical identity based Object methods
 boolean isAnalytic()
          Whether added whitespace is inside tags.
 boolean isClassic()
          Whether added whitespace is between tags.
 boolean isIndented()
          Whether indents are introduced into the document.
 boolean isMultiline()
          Whether newlines are introduced into the document.
(package private)  Object readResolve()
           
 int toInteger()
          Get an integer representation for this FormatType
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

AS_IS

public static final FormatType AS_IS

ANALYSIS

public static final FormatType ANALYSIS

CLASSIC

public static final FormatType CLASSIC

ANALYSIS_INDENT

public static final FormatType ANALYSIS_INDENT

CLASSIC_INDENT

public static final FormatType CLASSIC_INDENT

name

private String name
The name of the FormatType


indented

private boolean indented

multiline

private boolean multiline

analytic

private boolean analytic

classic

private boolean classic

nextObj

private static int nextObj

obj

private final int obj

VALUES

private static final FormatType[] VALUES

serialVersionUID

private static final long serialVersionUID
Serialization ID

See Also:
Constant Field Values
Constructor Detail

FormatType

public FormatType(String aName,
                  boolean displayNewlines,
                  boolean doIndenting,
                  boolean classicLines)
Simple ctor

Method Detail

isMultiline

public boolean isMultiline()
Whether newlines are introduced into the document.

Returns:
true if newlines are added to the document

isIndented

public boolean isIndented()
Whether indents are introduced into the document.

Returns:
true if indents are added to the document

isAnalytic

public boolean isAnalytic()
Whether added whitespace is inside tags. Note, this does not change the document.

Returns:
true if whitespace is added inside tags of document

isClassic

public boolean isClassic()
Whether added whitespace is between tags. Note, this does change the document as whitespace is added to either side of existing text.

Returns:
true if whitespace is added inside tags of document

toInteger

public int toInteger()
Get an integer representation for this FormatType


fromString

public static FormatType fromString(String name)
Lookup method to convert from a String


fromInteger

public static FormatType fromInteger(int i)
Lookup method to convert from an integer


equals

public final boolean equals(Object o)
Prevent subclasses from overriding canonical identity based Object methods

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public final int hashCode()
Prevent subclasses from overriding canonical identity based Object methods

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

toString

public String toString()
Overrides:
toString in class Object

readResolve

Object readResolve()

Copyright ? 2003-2004