public class URIParser
extends java.lang.Object
| Constructor and Description |
|---|
URIParser()
Creates a new URIParser object without custom prefixes.
|
URIParser(java.io.File extraPrefixes)
Creates a new empty URIParser object that can use custom prefixes.
|
URIParser(java.lang.String urilOrFragment)
Creates a new URIParser object for a given URI.
|
URIParser(java.lang.String urilOrFragment,
java.lang.String contextFileId,
java.lang.String contextGroupId,
java.lang.String contextUnitId)
Creates a new URIParser object for a given URI and context identifiers.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPrefixes(java.util.Map<java.lang.String,java.lang.String> map)
Adds a collection of uri/prefix to the prefixes resolver associated with this object.
|
URIParser |
complementReference()
Changes this object to represent a complete fragment identifier if the initial one was relative.
|
java.lang.String |
getContextFileId()
Gets the context file identifier of this URI's fragment.
|
java.lang.String |
getContextGroupId()
Gets the context group identifier of this URI's fragment.
|
java.lang.String |
getContextUnitId()
Gets the context unit identifier of this URI's fragment.
|
java.lang.String |
getDataId()
Gets the original data identifier of this URI's fragment.
|
boolean |
getErrorOnUnknownPrefix()
Gets the option to generate or not an error when finding an unknown prefix.
|
java.util.AbstractMap.SimpleEntry<java.lang.String,java.util.List<java.lang.String>> |
getExtensionInfo()
Gets the extension information for this fragment.
|
java.lang.String |
getFileId()
Gets the file identifier of this URI's fragment.
|
java.lang.String |
getGroupId()
Gets the group identifier of this URI's fragment.
|
java.lang.String |
getNoteId()
Gets the note identifier of this URI's fragment.
|
char |
getRefContainer()
Gets the type of container for this URI reference.
|
char |
getRefType()
Gets the type of reference for this URI's fragment.
|
java.lang.String |
getScope()
Gets the scope string for this URI's fragment.
|
java.lang.String |
getSourceInlineId()
Gets the segment or ignorable or source inline element of this URI's fragment.
|
java.lang.String |
getTargetInlineId()
Gets the target inline element identifier of this URI's fragment.
|
java.lang.String |
getUnitId()
Gets the unit identifier of this URI's fragment.
|
java.net.URI |
getURI()
Gets the URI object for this object.
|
boolean |
isFragmentOnly()
Indicates if this URI has only a fragment.
|
boolean |
isXLIFF()
Indicates if this URI has an XLIFF 2 fragment identifier.
|
void |
setErrorOnUnknownPrefix(boolean errorOnUnknownPrefix)
Sets the option of generating or not an error when finding an unknown prefix.
|
URIParser |
setURL(java.lang.String urilOrFragment)
Sets the URI for this object.
|
URIParser |
setURL(java.lang.String urilOrFragment,
java.lang.String contextFileId,
java.lang.String contextGroupId,
java.lang.String contextUnitId)
Sets the URI and context identifiers for this object.
|
java.lang.String |
toString() |
public URIParser()
public URIParser(java.io.File extraPrefixes)
extraPrefixes - the file object where the custom prefixes are declared (or null).public URIParser(java.lang.String urilOrFragment)
urilOrFragment - the URI to process (can be empty).InvalidParameterException - if there is an error in the fragment syntax.public URIParser(java.lang.String urilOrFragment,
java.lang.String contextFileId,
java.lang.String contextGroupId,
java.lang.String contextUnitId)
urilOrFragment - the URI to process (can be empty).contextFileId - the id of the <file> element enclosing where this URI is located (or null).contextGroupId - the id of the <group> element enclosing where this URI is located (or null).contextUnitId - the id of the <unit> element enclosing where this URI is located (or null).InvalidParameterException - if there is an error in the fragment syntax.public java.lang.String toString()
toString in class java.lang.Objectpublic void setErrorOnUnknownPrefix(boolean errorOnUnknownPrefix)
errorOnUnknownPrefix - true to generate an error, false to not generate an error.public boolean getErrorOnUnknownPrefix()
public void addPrefixes(java.util.Map<java.lang.String,java.lang.String> map)
map - the map to add.public URIParser setURL(java.lang.String urilOrFragment)
urilOrFragment - the URI to process (can be empty).InvalidParameterException - if there is an error in the fragment syntax.public URIParser setURL(java.lang.String urilOrFragment, java.lang.String contextFileId, java.lang.String contextGroupId, java.lang.String contextUnitId)
urilOrFragment - the URI to process (can be empty).contextFileId - the id of the <file> element enclosing where this URI is located (or null).contextGroupId - the id of the <group> element enclosing where this URI is located (or null).contextUnitId - the id of the <unit> element enclosing where this URI is located (or null).InvalidParameterException - if there is an error in the fragment syntax.public java.net.URI getURI()
public URIParser complementReference()
getRefContainer().public boolean isFragmentOnly()
public boolean isXLIFF()
public java.lang.String getFileId()
public java.lang.String getGroupId()
public java.lang.String getUnitId()
public java.lang.String getNoteId()
public java.lang.String getSourceInlineId()
public java.lang.String getTargetInlineId()
public java.lang.String getDataId()
public java.lang.String getContextFileId()
public java.lang.String getContextGroupId()
public java.lang.String getContextUnitId()
public java.util.AbstractMap.SimpleEntry<java.lang.String,java.util.List<java.lang.String>> getExtensionInfo()
public java.lang.String getScope()
public char getRefType()
public char getRefContainer()