public class XliffResourceBundleWrapper extends ResourceBundleWrapperRT
XliffResourceBundleWrapper provides a run-time
implementation of a ResourceBundleWrapper
for .xlf files.
The .xlf file is expected to use the "id" attribute in the "trans-unit"
node to store the "key" value.ResourceBundleWrapperRT.DefaultSearchContext, ResourceBundleWrapperRT.SearchTypeResourceBundleWrapper.KeyInfo_parent| Constructor and Description |
|---|
XliffResourceBundleWrapper() |
XliffResourceBundleWrapper(oracle.mds.core.MOKey mokey,
java.util.Locale locale)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addEntry(java.lang.String key,
java.lang.String text,
java.util.Map<java.lang.String,java.lang.String> metadata)
Adds a new entry (key, value, and optional metadata) into the
resource bundle.
|
ResourceBundleOperationResult |
addEntryNoDialog(java.lang.String key,
java.lang.String text,
java.util.Map<java.lang.String,java.lang.String> metadata)
Adds a new entry (key, value, and optional metadata) into the
resource bundle.
|
boolean |
deleteEntry(java.lang.String key)
Deletes the resource bundle entry identified by
key. |
protected java.util.Map<java.lang.String,ResourceBundleWrapper.KeyInfo> |
getBaseKeyMap() |
protected java.util.Map<java.lang.String,java.lang.String> |
getBaseKeyValueMap() |
protected org.w3c.dom.Document |
getDocument() |
java.util.Map<java.lang.String,java.lang.String> |
getKeyValueMap()
Gets the map of key-values for this bundle.
|
java.util.Map<java.lang.String,java.lang.String> |
getMetadata(java.lang.String key)
Gets the translated text (value) identified by
key |
protected oracle.mds.core.MetadataObject |
getMetadataObject(oracle.mds.core.MDSSession mdsSession,
java.lang.String fileName) |
protected oracle.mds.core.MetadataObject |
getMetadataObject(oracle.mds.core.MDSSession mdsSession,
java.lang.String fileName,
boolean writable) |
oracle.mds.core.MOKey |
getMOKey() |
java.lang.String |
getString(java.lang.String key)
Gets the translated text (value) identified by
key |
java.util.Set<java.lang.String> |
keySet()
Returns a set view of the keys contained in this resource bundle.
|
void |
parse(org.w3c.dom.Document document) |
void |
parse(org.w3c.dom.Document document,
java.util.Map<java.lang.String,ResourceBundleWrapper.KeyInfo> keyMap,
java.util.Map<java.lang.String,java.lang.String> keyValueMap) |
void |
parse(java.net.URL url) |
void |
setDocument(org.w3c.dom.Document document)
This should only be used when dealing with an override bundle and
via the AppBundleInfoRT class
|
void |
setParent(ResourceBundleWrapperRT parentBundle) |
void |
setWritable(boolean writable) |
void |
updateDocument(org.w3c.dom.Document document) |
boolean |
updateEntry(java.lang.String key,
java.lang.String text,
java.util.Map<java.lang.String,java.lang.String> metadata)
Updates the specified key to have the specified text and metadata.
|
ResourceBundleOperationResult |
updateEntryNoDialog(java.lang.String key,
java.lang.String text,
java.util.Map<java.lang.String,java.lang.String> metadata)
Updates the specified key to have the specified text and metadata while not
showing any dialog
|
addEntry, addResourceBundleListener, findKeys, findKeys, findKeysByMetaData, findKeysByMetaData, findKeysByText, findKeysByText, findKeysLikeKey, findKeysLikeKey, findKeysLikeMetaData, findKeysLikeText, findKeysLikeText, getBundleId, getChainedKeyValueMap, getChainedKeyValueMapNoOverride, getKeyGenerator, getMetadataFromParentChain, getParent, getParentChain, getParentList, refreshBundleIfNeeded, removeResourceBundleListener, setBundleId, setKeyGenerator, setParentList, setURL, toStringpublic XliffResourceBundleWrapper()
@Deprecated
public XliffResourceBundleWrapper(oracle.mds.core.MOKey mokey,
java.util.Locale locale)
public oracle.mds.core.MOKey getMOKey()
protected oracle.mds.core.MetadataObject getMetadataObject(oracle.mds.core.MDSSession mdsSession,
java.lang.String fileName)
protected oracle.mds.core.MetadataObject getMetadataObject(oracle.mds.core.MDSSession mdsSession,
java.lang.String fileName,
boolean writable)
protected java.util.Map<java.lang.String,ResourceBundleWrapper.KeyInfo> getBaseKeyMap()
protected java.util.Map<java.lang.String,java.lang.String> getBaseKeyValueMap()
public boolean addEntry(java.lang.String key,
java.lang.String text,
java.util.Map<java.lang.String,java.lang.String> metadata)
throws java.lang.UnsupportedOperationException
ResourceBundleWrapperaddEntry in interface ResourceBundleWrapperaddEntry in class ResourceBundleWrapperRTkey - The key name to use in the resource bundle.text - The text to be translated.metadata - Any associated metadata about the translation string
This parameter may be nulltrue on successjava.lang.UnsupportedOperationExceptionpublic ResourceBundleOperationResult addEntryNoDialog(java.lang.String key, java.lang.String text, java.util.Map<java.lang.String,java.lang.String> metadata)
ResourceBundleWrapperaddEntryNoDialog in interface ResourceBundleWrapperaddEntryNoDialog in class ResourceBundleWrapperRTkey - The key name to use in the resource bundle.text - The text to be translated.metadata - Any associated metadata about the translation string
This parameter may be nullpublic java.lang.String getString(java.lang.String key)
ResourceBundleWrapperkeygetString in interface ResourceBundleWrappergetString in class ResourceBundleWrapperRTkey - The key in the resource bundlepublic void setParent(ResourceBundleWrapperRT parentBundle)
public boolean updateEntry(java.lang.String key,
java.lang.String text,
java.util.Map<java.lang.String,java.lang.String> metadata)
ResourceBundleWrapperupdateEntry in interface ResourceBundleWrapperupdateEntry in class ResourceBundleWrapperRTkey - The key to updatetext - The new text for the given keymetadata - Any metadata to change. Existing metadata is merged with
the new metadata, unless there is a key with a null value, then the
existing metadata for that key is removed. If metadata is
null then the existing metadata will be unchanged.true on successpublic ResourceBundleOperationResult updateEntryNoDialog(java.lang.String key, java.lang.String text, java.util.Map<java.lang.String,java.lang.String> metadata)
ResourceBundleWrapperupdateEntryNoDialog in interface ResourceBundleWrapperupdateEntryNoDialog in class ResourceBundleWrapperRTkey - The key to updatetext - The new text for the given keymetadata - Any metadata to change. Existing metadata is merged with
the new metadata, unless there is a key with a null value, then the
existing metadata for that key is removed. If metadata is
null then the existing metadata will be unchanged.public boolean deleteEntry(java.lang.String key)
ResourceBundleWrapperkey. If
key does not exist, then a value of false is returned.deleteEntry in interface ResourceBundleWrapperdeleteEntry in class ResourceBundleWrapperRTkey - The key to deletetrue If the key is found and deleted success.public java.util.Set<java.lang.String> keySet()
ResourceBundleWrapperIterator
will throw an UnsupportedOperationException.public java.util.Map<java.lang.String,java.lang.String> getMetadata(java.lang.String key)
ResourceBundleWrapperkeykey - The key in the resource bundlepublic java.util.Map<java.lang.String,java.lang.String> getKeyValueMap()
ResourceBundleWrapperRTgetKeyValueMap in class ResourceBundleWrapperRTpublic void setWritable(boolean writable)
public void parse(java.net.URL url)
parse in class ResourceBundleWrapperRTpublic void setDocument(org.w3c.dom.Document document)
protected org.w3c.dom.Document getDocument()
public void parse(org.w3c.dom.Document document)
public void parse(org.w3c.dom.Document document,
java.util.Map<java.lang.String,ResourceBundleWrapper.KeyInfo> keyMap,
java.util.Map<java.lang.String,java.lang.String> keyValueMap)
public void updateDocument(org.w3c.dom.Document document)