Package com.day.util.diff
Class LineElementsFactory
java.lang.Object
com.day.util.diff.LineElementsFactory
- All Implemented Interfaces:
ElementsFactory
Implements an element factory that creates elements from the lines of an
input text.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
An element that is based on a string but ignores the whitespaces in the equals method.static class
An element that is based on a string todo: create non-annotated varian -
Field Summary
Fields inherited from interface com.day.util.diff.ElementsFactory
CVS_ID
-
Method Summary
Modifier and TypeMethodDescriptionstatic LineElementsFactory
create
(DocumentSource source, Reader text, boolean ignoreWs) Create a new line element factory for the given source.static LineElementsFactory
create
(DocumentSource source, String text, boolean ignoreWs) Create a new line element factory for the given text.static LineElementsFactory
create
(FileDocumentSource source, boolean ignoreWs) Deprecated.static LineElementsFactory
create
(FileDocumentSource source, boolean ignoreWs, String charset) Create a new line element factory for the given source.Provides the elements
-
Method Details
-
getElements
Provides the elements- Specified by:
getElements
in interfaceElementsFactory
- Returns:
- an array of elements
-
create
Create a new line element factory for the given text.- Parameters:
source
- the document sourcetext
- the textignoreWs
- iftrue
white spaces are ignored for the diff- Returns:
- the new factory todo: create non-annotated variant
-
create
public static LineElementsFactory create(FileDocumentSource source, boolean ignoreWs) throws IOException Deprecated.usecreate(FileDocumentSource, boolean, String)
insteadCreate a new line element factory for the given source.- Parameters:
source
- the file sourceignoreWs
- iftrue
white spaces are ignored for the diff- Returns:
- the new factory
- Throws:
IOException
- if an I/O error occurs
-
create
public static LineElementsFactory create(FileDocumentSource source, boolean ignoreWs, String charset) throws IOException Create a new line element factory for the given source.- Parameters:
source
- the file sourceignoreWs
- iftrue
white spaces are ignored for the diffcharset
- the charset- Returns:
- the new factory
- Throws:
IOException
- if an I/O error occurs todo: create non-annotated variant
-
create
public static LineElementsFactory create(DocumentSource source, Reader text, boolean ignoreWs) throws IOException Create a new line element factory for the given source.- Parameters:
source
- the sourcetext
- the textignoreWs
- iftrue
white spaces are ignored for the diff- Returns:
- the new factory
- Throws:
IOException
- if an I/O error occurs todo: create non-annotated variant
-
create(FileDocumentSource, boolean, String)
instead