public class HrefService extends Service implements HrefHandler
| Modifier and Type | Field and Description |
|---|---|
static int |
CACHE_SIZE
The default cache size, in bytes.
|
| Constructor and Description |
|---|
HrefService(Node contextNode,
int nHrefCacheSize)
Instantiates a new
HrefService using a specified
contextNode as the context for resolving
relative references. |
HrefService(String sConfigSchemaName,
int nHrefCacheSize)
Instantiates a new
HrefService using the configuration
to determine the node that will service as the context for resolving
relative references. |
| Modifier and Type | Method and Description |
|---|---|
void |
clearCache()
Clears the cache.
|
String |
getAlternativeUrl()
Gets the alternate URL that relative hrefs will be resolved against.
|
String |
getBaseUrl()
Gets the base URL that relative hrefs will be resolved against.
|
int |
getCacheSize()
Gets the size of the cache in bytes.
|
String |
getConfigSchemaName()
Gets the configuration schema name associated with this service.
|
Node |
getContextNode()
Gets the context node associated with this service.
|
int |
getCurrentCacheSize()
Gets the current size of the cache in bytes.
|
Model |
getDocument(AppModel appModel)
Gets the
TemplateModel associated with the
given AppModel. |
boolean |
isTrusted()
Get the trustiness of absolute URLs.
|
void |
isTrusted(boolean bTrusted)
Sets the trustiness of absolute urls.
|
AppModel |
loadFragment(AppModel appModel,
String sUrl)
Resolves a URL and loads the reference XFA document into a new
AppModel. |
AppModel |
loadFragment(ProtoableNode protoableNode)
Resolves the
usehref attribute in the given ProtoableNode and
loads the referenced document into a new AppModel. |
void |
setAlternativeUrl(String sAltUrl)
Sets the alternate URL that relative hrefs will be resolved against.
|
void |
setBaseUrl(String sBaseUrl)
Sets the base URL that relative hrefs will be resolved against.
|
void |
setContextNode(Node contextNode)
Sets the context node associated with this service.
|
public static final int CACHE_SIZE
public HrefService(Node contextNode, int nHrefCacheSize)
HrefService using a specified
contextNode as the context for resolving
relative references.contextNode - the context node for resolving relative references.nHrefCacheSize - the maximum size of the cache of URL bytes. If negative,
no caching is done. If zero, CACHE_SIZE is used.public HrefService(String sConfigSchemaName, int nHrefCacheSize)
HrefService using the configuration
to determine the node that will service as the context for resolving
relative references.sConfigSchemaName - the name of the configuration element containing
the template.base and template.uri elements that
describe how relative references are to be resolved.nHrefCacheSize - the maximum size of the cache of URL bytes. If negative,
no caching is done. If zero, CACHE_SIZE is used.public final Node getContextNode()
public final String getConfigSchemaName()
public final void setContextNode(Node contextNode)
contextNode - the context node.public final boolean isTrusted()
true, absolute hrefs are allowed.public final void isTrusted(boolean bTrusted)
bTrusted - allow absolute URLs when true.public final int getCacheSize()
public final void clearCache()
public final int getCurrentCacheSize()
public AppModel loadFragment(ProtoableNode protoableNode)
usehref attribute in the given ProtoableNode and
loads the referenced document into a new AppModel.
Any fragment identifier in the URL is ignored.loadFragment in interface HrefHandlerprotoableNode - a ProtoableNode with a usehref attribute.AppModel containing the document loaded
from the referenced location, or null upon error.public AppModel loadFragment(AppModel appModel, String sUrl)
AppModel.
Any fragment identifier in the URL is ignored.loadFragment in interface HrefHandlerappModel - the AppModel containing the URLsUrl - the URL that references the external XFA documentAppModel containing the document loaded
from the referenced location.public Model getDocument(AppModel appModel)
TemplateModel associated with the
given AppModel.getDocument in interface HrefHandlerappModel - an AppModelTemplateModel from appModel
or null if there is no TemplateModel.public final String getBaseUrl()
public final void setBaseUrl(String sBaseUrl)
sBaseUrl - a URL to resolve relative hrefs against.public final String getAlternativeUrl()
public final void setAlternativeUrl(String sAltUrl)
sAltUrl - a URL to resolve relative hrefs against.Copyright © 2010 - 2020 Adobe. All Rights Reserved