public class ParseContext extends Object
Modifier and Type | Field and Description |
---|---|
protected org.archive.url.UsableURI |
baseUrl |
Constructor and Description |
---|
ParseContext()
constructor
|
Modifier and Type | Method and Description |
---|---|
String |
contextualizeUrl(String url) |
String |
getData(String key)
Retrieves previously stored data for key key from this ParseContext
|
Map<String,String> |
getMap() |
String |
getOraclePolicy() |
boolean |
isInCSS() |
boolean |
isInHTML() |
boolean |
isInJS() |
boolean |
isInScriptText() |
void |
putData(String key,
String value)
Stores arbitrary key value pairs in this ParseContext
|
String |
resolve(String url)
Resolve possibly-relative
url with baseUrl set to
this object. |
void |
setBaseUrl(String baseURL) |
void |
setBaseUrl(URL url) |
void |
setInCSS(boolean inCSS) |
void |
setInHTML(boolean inHTML)
set to
true when any HTML open tag
is found. |
void |
setInJS(boolean inJS) |
void |
setInScriptText(boolean inScriptText) |
void |
setOraclePolicy(String policy) |
public void putData(String key, String value)
key
- for storagevalue
- for storagepublic String getData(String key)
key
- under which value was storedpublic Map<String,String> getMap()
public void setBaseUrl(String baseURL)
baseURL
- an base URL for relative URLspublic void setBaseUrl(URL url)
url
- against which relative URLs should be resolved for this parsepublic String resolve(String url) throws URISyntaxException
url
with baseUrl
set to
this object.
Caveat: this method no longer unescape HTML entities in url
.
HTML entities must be all unescaped before calling method.
url
- which should be resolvedURISyntaxException
- if the input URL is malformedpublic String contextualizeUrl(String url)
url
- which should be resolved.public void setInHTML(boolean inHTML)
true
when any HTML open tag
is found.
used for checking if the content really looks like an HTML document.
inHTML
- public boolean isInHTML()
public boolean isInCSS()
public void setInCSS(boolean inCSS)
inCSS
- the inCSS to setpublic boolean isInJS()
public void setInJS(boolean inJS)
inJS
- the inJS to setpublic boolean isInScriptText()
public void setInScriptText(boolean inScriptText)
inScriptText
- the inScriptText to setpublic String getOraclePolicy()
public void setOraclePolicy(String policy)
Copyright © 2005–2015 IIPC. All rights reserved.