|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.beasys.commerce.axiom.document.loader.MetaParser
A utility which can pull META tags from an HTML file.
This will also pull the title of an HTML from the <title></title> section anywhere in the document. No matter what the casing of the title tag, it will be put in the metadata properties as "title".
This requires the OROMatcher1.1 class library (which provides regular expression support). This library is bundled with WebLogic Server.
Field Summary | |
static java.lang.String |
attrPatStr
The Perl5 regular exprssion to find a name="value" pair. |
static java.lang.String |
metaTagPatStr
The Perl5 regular expression string for finding META tags. |
static java.lang.String |
patStr
The Perl5 regular expression string to search for. |
static java.lang.String |
titlePatStr
The Perl5 regular expression string for finding TITLE tags. |
Constructor Summary | |
MetaParser()
|
Method Summary | |
static java.util.Properties |
load(java.io.BufferedReader reader,
java.util.Properties p)
Load the META tag name/value pairs from the input stream into p. |
static java.util.Properties |
load(java.io.File f,
java.util.Properties p)
Load the META tag name/value pairs from f into p. |
static java.util.Properties |
load(java.io.File f,
java.util.Properties p,
java.lang.String enc)
Load the META tag name/value pairs from f into p. |
void |
loadProperties(java.io.File f,
java.util.Properties p,
BulkLoader loader)
Load the file-specific properties for the specified file into the properties, running under the given BulkLoader. |
static void |
main(java.lang.String[] args)
Little test program which grags the META tags from the first argument. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String attrPatStr
public static final java.lang.String metaTagPatStr
public static final java.lang.String titlePatStr
public static final java.lang.String patStr
Constructor Detail |
public MetaParser()
Method Detail |
public void loadProperties(java.io.File f, java.util.Properties p, BulkLoader loader)
If the filter doesn't support the given file type or if there is an
error, it should do nothing. This can use the error(), warning(), and
debug() methods on the specified loader. Filters can also use
GlobHelper
and
MimeTypeHelper
to determine if they
should do something with the file.
public static java.util.Properties load(java.io.File f, java.util.Properties p) throws java.io.IOException
f
- the file.p
- the properties object (null to create new).public static java.util.Properties load(java.io.File f, java.util.Properties p, java.lang.String enc) throws java.io.IOException
The file is assumed to be encoded in the specified encoding.
f
- the file.p
- the properties object (null to create new).enc
- the file encoding name (null for default).public static java.util.Properties load(java.io.BufferedReader reader, java.util.Properties p) throws java.io.IOException
This operates on a last-seen-is-returned alogirithm for META tags with the same name. It will also find all meta tags in file, not just those in the head.
reader
- the input reader.p
- the properties object (null to create new).public static void main(java.lang.String[] args) throws java.lang.Exception
|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |