net.sf.mmm.util.xml.api
Class XmlCompareMode

java.lang.Object
  extended by net.sf.mmm.util.xml.api.XmlCompareMode

public class XmlCompareMode
extends Object

This class is a simple bean that represents the mode when comparing XML.

Since:
1.0.2
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
private  boolean checkComments
           
private  boolean joinCData
           
private  boolean joinComment
           
private  boolean joinText
           
private  boolean normalizeSpaces
           
 
Constructor Summary
XmlCompareMode()
          The constructor.
 
Method Summary
 boolean isCheckComments()
          This method determines how Comments are compared.
 boolean isJoinCData()
          This method determines if subsequent CDATASection-nodes should be treated as one single CDATASection-node when comparing XML.
 boolean isJoinComment()
          This method determines if subsequent Comment-nodes should be treated as one single Comment-node when comparing XML.
 boolean isJoinText()
          This method determines if subsequent Text-nodes should be treated as one single Text-node when comparing XML.
 boolean isNormalizeSpaces()
          This method determines how to deal with whitespace-characters ' ' ,'\t','\r', and '\n' when comparing content of Text (or CDATASection).
 void setCheckComments(boolean checkComments)
           
 void setJoinCData(boolean joinCData)
           
 void setJoinComment(boolean joinComments)
           
 void setJoinText(boolean joinText)
           
 void setNormalizeSpaces(boolean normalizeSpaces)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

checkComments

private boolean checkComments
See Also:
isCheckComments()

normalizeSpaces

private boolean normalizeSpaces
See Also:
isNormalizeSpaces()

joinText

private boolean joinText
See Also:
isJoinText()

joinCData

private boolean joinCData
See Also:
isJoinCData()

joinComment

private boolean joinComment
See Also:
isJoinComment()
Constructor Detail

XmlCompareMode

public XmlCompareMode()
The constructor.

Method Detail

isCheckComments

public boolean isCheckComments()
This method determines how Comments are compared.

Returns:
true if comments will be compared, false to ignore comments.

setCheckComments

public void setCheckComments(boolean checkComments)
Parameters:
checkComments - is the checkComments to set

isNormalizeSpaces

public boolean isNormalizeSpaces()
This method determines how to deal with whitespace-characters ' ' ,'\t','\r', and '\n' when comparing content of Text (or CDATASection).

Returns:
true if leading and trailing whitespace-characters will be ignored around line-breaks (breaking and indentation does NOT matter) and false if all whitespace-characters have to be equal.

setNormalizeSpaces

public void setNormalizeSpaces(boolean normalizeSpaces)
Parameters:
normalizeSpaces - is the normalizeSpaces to set

isJoinText

public boolean isJoinText()
This method determines if subsequent Text-nodes should be treated as one single Text-node when comparing XML. The default is true. If both joinText joinCData are set, Text and CDATASection are treated as equal, what means that all text between nodes is treated as single text no matter what node-structure is used to represent it.

Returns:
true if the content of Text-nodes should joined before comparison, false if each Text-node is compared separately.

setJoinText

public void setJoinText(boolean joinText)
Parameters:
joinText - is the joinText to set

isJoinCData

public boolean isJoinCData()
This method determines if subsequent CDATASection-nodes should be treated as one single CDATASection-node when comparing XML. The default is true. If both joinText joinCData are set, Text and CDATASection are treated as equal, what means that all text between nodes is treated as single text no matter what node-structure is used to represent it.

Returns:
true if the content of CDATASection-nodes should joined before comparison, false if each CDATASection-node is compared separately.

setJoinCData

public void setJoinCData(boolean joinCData)
Parameters:
joinCData - is the joinCData to set

isJoinComment

public boolean isJoinComment()
This method determines if subsequent Comment-nodes should be treated as one single Comment-node when comparing XML.

Returns:
true if the content of Comment -nodes should joined before comparison, false if each Comment-node is compared separately.

setJoinComment

public void setJoinComment(boolean joinComments)
Parameters:
joinComments - is the joinComments to set


Copyright © 2001-2010 mmm-Team. All Rights Reserved.