This class holds the information about HTML "meta" tags extracted from
a page. Some special tags have convenience methods for easy checking.
| Method from org.apache.nutch.parse.HTMLMetaTags Detail: |
public URL getBaseHref() {
return baseHref;
}
A convenience method. Returns the baseHref, if set, or
null otherwise. |
public Properties getGeneralTags() {
return generalTags;
}
Returns all collected values of the general meta tags. Property names are
tag names, property values are "content" values. |
public Properties getHttpEquivTags() {
return httpEquivTags;
}
Returns all collected values of the "http-equiv" meta tags. Property names
are tag names, property values are "content" values. |
public boolean getNoCache() {
return noCache;
}
A convenience method. Returns the current value of noCache. |
public boolean getNoFollow() {
return noFollow;
}
A convenience method. Returns the current value of noFollow. |
public boolean getNoIndex() {
return noIndex;
}
A convenience method. Returns the current value of noIndex. |
public boolean getRefresh() {
return refresh;
}
A convenience method. Returns the current value of refresh. |
public URL getRefreshHref() {
return refreshHref;
}
A convenience method. Returns the refreshHref, if set, or
null otherwise. The value may be invalid if
#getRefresh() returns false. |
public int getRefreshTime() {
return refreshTime;
}
A convenience method. Returns the current value of refreshTime.
The value may be invalid if #getRefresh() returns
false. |
public void reset() {
noIndex = false;
noFollow = false;
noCache = false;
refresh = false;
refreshTime = 0;
baseHref = null;
refreshHref = null;
generalTags.clear();
httpEquivTags.clear();
}
Sets all boolean values to false. Clears all other tags. |
public void setBaseHref(URL baseHref) {
this.baseHref = baseHref;
}
|
public void setNoCache() {
noCache = true;
}
|
public void setNoFollow() {
noFollow = true;
}
|
public void setNoIndex() {
noIndex = true;
}
|
public void setRefresh(boolean refresh) {
this.refresh = refresh;
}
Sets refresh to the supplied value. |
public void setRefreshHref(URL refreshHref) {
this.refreshHref = refreshHref;
}
|
public void setRefreshTime(int refreshTime) {
this.refreshTime = refreshTime;
}
|
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("base=" + baseHref
+ ", noCache=" + noCache
+ ", noFollow=" + noFollow
+ ", noIndex=" + noIndex
+ ", refresh=" + refresh
+ ", refreshHref=" + refreshHref + "\n"
);
sb.append(" * general tags:\n");
Iterator it = generalTags.keySet().iterator();
while (it.hasNext()) {
String key = (String)it.next();
sb.append(" - " + key + "\t=\t" + generalTags.get(key) + "\n");
}
sb.append(" * http-equiv tags:\n");
it = httpEquivTags.keySet().iterator();
while (it.hasNext()) {
String key = (String)it.next();
sb.append(" - " + key + "\t=\t" + httpEquivTags.get(key) + "\n");
}
return sb.toString();
}
|