public class WarcFieldParsers extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Diagnostics<Diagnosis> |
diagnostics
Diagnostics used to report diagnoses.
|
| Constructor and Description |
|---|
WarcFieldParsers() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addEmptyWarning(String entity)
Add a warning diagnosis on the given entity stating that it is empty.
|
protected void |
addInvalidExpectedError(String entity,
String... information)
Add an error diagnosis on the given entity stating that it is invalid
and something else was expected.
|
protected ContentType |
parseContentType(String contentTypeStr,
String field)
Parse and validate content-type string with optional parameters.
|
protected Date |
parseDate(String dateStr,
String field)
Parses WARC record date.
|
protected WarcDigest |
parseDigest(String labelledDigest,
String field)
Parse and validate WARC digest string.
|
protected Integer |
parseInteger(String intStr,
String field)
Returns an Integer object holding the value of the specified string.
|
protected InetAddress |
parseIpAddress(String ipAddress,
String field)
Parse and validate an IP address.
|
protected Long |
parseLong(String longStr,
String field)
Returns a Long object holding the value of the specified string.
|
protected String |
parseString(String str,
String field)
Validates that the string is not null.
|
protected Uri |
parseUri(String uriStr,
boolean bLtGt,
UriProfile uriProfile,
String field)
Returns an URI object holding the value of the specified string.
|
protected Diagnostics<Diagnosis> diagnostics
public WarcFieldParsers()
protected void addInvalidExpectedError(String entity, String... information)
entity - entity examinedinformation - optional extra informationprotected void addEmptyWarning(String entity)
entity - entity examinedprotected String parseString(String str, String field)
str - the value to validatefield - field nameprotected Integer parseInteger(String intStr, String field)
intStr - the value to parse.field - field nameprotected Long parseLong(String longStr, String field)
longStr - the value to parse.field - field nameprotected ContentType parseContentType(String contentTypeStr, String field)
contentTypeStr - content-type string to parsefield - field nameprotected InetAddress parseIpAddress(String ipAddress, String field)
ipAddress - the IP address to parsefield - field nameprotected Uri parseUri(String uriStr, boolean bLtGt, UriProfile uriProfile, String field)
uriStr - the URL to parsefield - field nameuriProfile - the uri profilebLtGt - somethingprotected Date parseDate(String dateStr, String field)
dateStr - the date to parse.field - field nameprotected WarcDigest parseDigest(String labelledDigest, String field)
labelledDigest - WARC digest string to parsefield - field nameCopyright © 2011–2015. All rights reserved.