Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
mLogger |
Constructor and Description |
---|
ParseUtil(Configuration conf) |
Modifier and Type | Method and Description |
---|---|
boolean |
isParserRegistered(String extensionId) |
Parse |
parse(Content content)
|
Parse |
parseByExtensionId(String extId,
Content content)
|
public ParseUtil(Configuration conf)
conf
- public Parse parse(Content content) throws ParseException
Parser
s
until a successful parse is performed and a Parse
object is
returned. If the parse is unsuccessful, a message is logged to the
WARNING
level, and an empty parse is returned.content
- The content to try and parse.Parse
object containing the parsed data.ParseException
- If no suitable parser is found to perform the parse.public Parse parseByExtensionId(String extId, Content content) throws ParseException
Content
object using the Parser
specified
by the parameter extId
, i.e., the Parser's extension ID.
If a suitable Parser
is not found, then a WARNING
level message is logged, and a ParseException is thrown. If the parse is
uncessful for any other reason, then a WARNING
level
message is logged, and a ParseStatus.getEmptyParse()
is
returned.extId
- The extension implementation ID of the Parser
to use
to parse the specified content.content
- The content to parse.Parse
object if the parse is successful, otherwise,
a ParseStatus.getEmptyParse()
.ParseException
- If there is no suitable Parser
found
to perform the parse.public boolean isParserRegistered(String extensionId)
Copyright © 2007, 2014, Oracle and/or its affiliates. All rights reserved.