public class RedPen extends Object
Constructor and Description |
---|
RedPen(Configuration configuration)
constructs RedPen with specified configuration.
|
RedPen(File configFile)
constructs RedPen with specified config file.
|
RedPen(String configPath)
constructs RedPen with specified config file path.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Configuration |
getConfiguration()
Get the configuration object for this RedPen
|
List<Validator> |
getValidators()
Get validators associated with this RedPen instance
|
int |
hashCode() |
List<Document> |
parse(DocumentParser parser,
File[] files)
parse given files.
|
Document |
parse(DocumentParser parser,
InputStream InputStream)
parse given input stream.
|
Document |
parse(DocumentParser parser,
String content)
parse given content.
|
String |
toString() |
List<ValidationError> |
validate(Document document)
validate the input document collection.
|
Map<Document,List<ValidationError>> |
validate(List<Document> documents)
validate the input document collection.
|
public static final String VERSION
public RedPen(File configFile) throws RedPenException
configFile
- config fileRedPenException
- when failed to construct RedPenpublic RedPen(String configPath) throws RedPenException
configPath
- config file pathRedPenException
- when failed to construct RedPenpublic RedPen(Configuration configuration) throws RedPenException
configuration
- configurationRedPenException
- when failed to construct RedPenpublic Document parse(DocumentParser parser, InputStream InputStream) throws RedPenException
parser
- DocumentParser parserInputStream
- content to parseRedPenException
- when failed to parse input streampublic Document parse(DocumentParser parser, String content) throws RedPenException
parser
- DocumentParser parsercontent
- content to parseRedPenException
- when failed to parse input streampublic List<Document> parse(DocumentParser parser, File[] files) throws RedPenException
parser
- DocumentParser parserfiles
- files to parseRedPenException
- when failed to parse input streampublic Map<Document,List<ValidationError>> validate(List<Document> documents)
documents
- input document collection generated by Parserpublic List<ValidationError> validate(Document document)
document
- document to be validatedpublic List<Validator> getValidators()
public Configuration getConfiguration()
Copyright © 2015. All rights reserved.