Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 2 (11.1.2.2.0)

E17486-03


oracle.adf.share.common.rc.util.impl
Class MetadataRegistryImpl

java.lang.Object
  extended by oracle.adf.share.common.rc.util.MetadataRegistry
      extended by oracle.adf.share.common.rc.util.impl.MetadataRegistryImpl

Direct Known Subclasses:
MetadataRegistryBigImpl

public class MetadataRegistryImpl
extends MetadataRegistry
For internal use only. Application developers should not use this
This class must only be used from the base class

Nested Class Summary
protected static class MetadataRegistryImpl.Context
           
static class MetadataRegistryImpl.DTDSkippingResolver
           
protected static class MetadataRegistryImpl.IterateNodeListAttributes
           

 

Nested classes/interfaces inherited from class oracle.adf.share.common.rc.util.MetadataRegistry
MetadataRegistry.PathVisitor, MetadataRegistry.PathVisitor2

 

Field Summary
protected static JarDocumentCache docCache
           
protected static java.util.logging.Logger logger
           

 

Fields inherited from class oracle.adf.share.common.rc.util.MetadataRegistry
ADFMXML_SIG, ADFMXML_SIG_LEN, BC4JCONFIGNS, BC4JNS, CPXREGISTRY, DCXREGISTRY, JPXREGISTRY, PATH_ATTR, WILDARD, XCFGREGISTRY, XMLNS_METAINF, XMLNS_SCHEMA

 

Constructor Summary
MetadataRegistryImpl()
           

 

Method Summary
 java.util.Iterator<java.lang.String> getAttributeIterator(java.net.URL xmlUrl, java.lang.String elemNS, java.lang.String elemName, java.lang.String attrName)
          Return an iterator with the values of the attribute, for the element, within the XML document at the location specified in the xmlUrl.
 java.util.Collection<java.util.Map<java.lang.String,java.lang.Object>> getAttributeMaps(java.net.URL xmlURL, java.lang.String elemNS, java.lang.String elemName)
          Return a collection of attribute maps for the items matching the element, within the XML document at the location specified in the xmlUrl.
protected  void getDocumentForWriting(MetadataRegistryImpl.Context ctx)
           
 org.w3c.dom.Document getDomDocument(java.net.URL url)
          Parse and return the DOM document located at the URL.
protected  java.io.OutputStream getOutputStream(MetadataRegistryImpl.Context ctx)
           
 java.util.Iterator<java.lang.String> getRegistryPaths(java.net.URL adfmXmlUrl, java.lang.String[] registryNSs, java.lang.String[] registryNames)
          Takes a URL of an adfm.xml file and returns an iterator to all the RegistryType paths contained within it (as relative paths).
 java.util.Iterator<java.lang.String> getRegistryPaths(java.net.URL adfmXmlUrl, java.lang.String registryNS, java.lang.String registryName)
          Takes a URL of an adfm.xml file and returns an iterator to all the RegistryType paths contained within it (as relative paths).
 java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getSubtreeList(org.w3c.dom.Document xmldocument, java.net.URL xmlUrl, java.lang.String elemNS, java.lang.String elemName, java.lang.String nvpChildName)
          This is used to simplify data extraction from the jbo dt files, the prime example being the JboProject file, see jbo_03_01.dtd.
 java.net.URL[] listFiles(java.net.URL url)
           
protected  org.w3c.dom.Document newDomDocument(java.net.URL url)
           
protected  java.io.InputStream openStream(java.net.URL url)
           
protected  java.net.URL preprocessURL(java.net.URL url)
           
 JarDocumentCache.Stats resetCacheStats(int capacity)
           
 void saveDocumentTo(org.w3c.dom.Document doc, java.net.URL saveTo)
          Causes the document passed in to be saved to the URL passed in.
protected  void saveDomDocument(MetadataRegistryImpl.Context ctx)
           
 java.net.URL setBaseURL(java.net.URL newBaseURL)
           
 void setPreserveWhitespace(java.lang.Boolean preserve)
          Sets the whitespace preservation to use when parsing documents.
 void setValidationMode(java.lang.Integer mode)
          Sets the validation mode to use when parsing documents.
 boolean updateElementsInMetadataRegistry(java.util.Collection<java.lang.String> relativePaths, java.util.Map<java.lang.String,java.lang.String> elementXref, java.net.URL adfmXmlUrl)
          See updateElementsInMetadataRegistryEx
 boolean updateElementsInMetadataRegistryEx(java.util.Collection<java.lang.String> relativePaths, java.util.Collection<java.lang.String> removalPaths, java.util.Map<java.lang.String,java.lang.String> elementXref, java.net.URL adfmXmlUrl, int[] remaining)
          Process all elements in the list of relativePaths referring to elementXref to get the elementNames corresponding to the extensions encountered.
 boolean updateRegistryElement(java.lang.String relativePath, java.lang.String elementNS, java.lang.String elementName, org.w3c.dom.Document doc)
          Update a single path attribute in the metadata registry passed as the doc param, and the elementName and elementNS are the specifics of the item to make the change on.
 void visitRegistryPaths(java.lang.ClassLoader loader, java.lang.String[] regNSs, java.lang.String[] regNames, MetadataRegistry.PathVisitor visitor)
          Within the list of metadata registries (META-INF/adfm.xml) in the class loader, find all registries within each matching the namespace and element name.
 void visitRegistryPaths(java.lang.ClassLoader loader, java.lang.String regNS, java.lang.String regName, MetadataRegistry.PathVisitor visitor)
          Within the list of metadata registries (META-INF/adfm.xml) in the class loader, find all registries within each matching the namespace and element name.

 

Methods inherited from class oracle.adf.share.common.rc.util.MetadataRegistry
newInstance

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

logger

protected static java.util.logging.Logger logger

docCache

protected static JarDocumentCache docCache

Constructor Detail

MetadataRegistryImpl

public MetadataRegistryImpl()

Method Detail

resetCacheStats

public JarDocumentCache.Stats resetCacheStats(int capacity)

visitRegistryPaths

public void visitRegistryPaths(java.lang.ClassLoader loader,
                               java.lang.String regNS,
                               java.lang.String regName,
                               MetadataRegistry.PathVisitor visitor)
                        throws java.io.IOException,
                               org.xml.sax.SAXException,
                               javax.xml.parsers.ParserConfigurationException,
                               java.net.MalformedURLException
Description copied from class: MetadataRegistry
Within the list of metadata registries (META-INF/adfm.xml) in the class loader, find all registries within each matching the namespace and element name. And for each of those dispatch to the visitor with the url of the entry path.
Specified by:
visitRegistryPaths in class MetadataRegistry
Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.net.MalformedURLException
See Also:
MetadataRegistry.PathVisitor2

visitRegistryPaths

public void visitRegistryPaths(java.lang.ClassLoader loader,
                               java.lang.String[] regNSs,
                               java.lang.String[] regNames,
                               MetadataRegistry.PathVisitor visitor)
                        throws java.io.IOException,
                               org.xml.sax.SAXException,
                               javax.xml.parsers.ParserConfigurationException,
                               java.net.MalformedURLException
Description copied from class: MetadataRegistry
Within the list of metadata registries (META-INF/adfm.xml) in the class loader, find all registries within each matching the namespace and element name. And for each of those dispatch to the visitor with the url of the entry path.
Specified by:
visitRegistryPaths in class MetadataRegistry
regNSs - array of namespace, length must match regNames length
regNames - array of registry names, length must match regNSs length
Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.net.MalformedURLException
See Also:
MetadataRegistry.PathVisitor2

getAttributeIterator

public java.util.Iterator<java.lang.String> getAttributeIterator(java.net.URL xmlUrl,
                                                                 java.lang.String elemNS,
                                                                 java.lang.String elemName,
                                                                 java.lang.String attrName)
                                                          throws java.io.IOException,
                                                                 org.xml.sax.SAXException,
                                                                 javax.xml.parsers.ParserConfigurationException
Description copied from class: MetadataRegistry
Return an iterator with the values of the attribute, for the element, within the XML document at the location specified in the xmlUrl.
Specified by:
getAttributeIterator in class MetadataRegistry
Returns:
the iterator of attribute values
Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException

getAttributeMaps

public java.util.Collection<java.util.Map<java.lang.String,java.lang.Object>> getAttributeMaps(java.net.URL xmlURL,
                                                                                               java.lang.String elemNS,
                                                                                               java.lang.String elemName)
                                                                                        throws java.io.IOException,
                                                                                               org.xml.sax.SAXException,
                                                                                               javax.xml.parsers.ParserConfigurationException
Description copied from class: MetadataRegistry
Return a collection of attribute maps for the items matching the element, within the XML document at the location specified in the xmlUrl.
Specified by:
getAttributeMaps in class MetadataRegistry
elemNS - default is BC4JCONFIGNS, the bc4j/configuration (xcfg files)
elemName - (Most likely something like, AppModuleConfig)
Returns:
the collection, one per matching element. Each map represents the attributes of a matching element.
Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException

getRegistryPaths

public java.util.Iterator<java.lang.String> getRegistryPaths(java.net.URL adfmXmlUrl,
                                                             java.lang.String registryNS,
                                                             java.lang.String registryName)
                                                      throws java.io.IOException,
                                                             org.xml.sax.SAXException,
                                                             javax.xml.parsers.ParserConfigurationException
Description copied from class: MetadataRegistry
Takes a URL of an adfm.xml file and returns an iterator to all the RegistryType paths contained within it (as relative paths).
Specified by:
getRegistryPaths in class MetadataRegistry
Parameters:
adfmXmlUrl - the full URL of a single adfm.xml.
registryNS - is the schema type namespace to request. If null then the document namespace is assumed. The wildcard "*" is accepted.
registryName - is the schema type local name to request. The wildcard "*" is accepted.
Returns:
an iterator of all the RegistryType path attributes as relative paths as they're represented in the registry path attribute.
Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException

getRegistryPaths

public java.util.Iterator<java.lang.String> getRegistryPaths(java.net.URL adfmXmlUrl,
                                                             java.lang.String[] registryNSs,
                                                             java.lang.String[] registryNames)
                                                      throws java.io.IOException,
                                                             org.xml.sax.SAXException,
                                                             javax.xml.parsers.ParserConfigurationException
Description copied from class: MetadataRegistry
Takes a URL of an adfm.xml file and returns an iterator to all the RegistryType paths contained within it (as relative paths).
Specified by:
getRegistryPaths in class MetadataRegistry
Parameters:
adfmXmlUrl - the full URL of a single adfm.xml.
Returns:
an iterator of all the RegistryType path attributes as relative paths as they're represented in the registry path attribute.
Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException

getSubtreeList

public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getSubtreeList(org.w3c.dom.Document xmldocument,
                                                                                       java.net.URL xmlUrl,
                                                                                       java.lang.String elemNS,
                                                                                       java.lang.String elemName,
                                                                                       java.lang.String nvpChildName)
                                                                                throws javax.xml.parsers.ParserConfigurationException,
                                                                                       org.xml.sax.SAXException,
                                                                                       java.io.IOException
Description copied from class: MetadataRegistry
This is used to simplify data extraction from the jbo dt files, the prime example being the JboProject file, see jbo_03_01.dtd.
Specified by:
getSubtreeList in class MetadataRegistry
Parameters:
xmldocument - pre-loaded document to avoid loading
xmlUrl - the location of the metadata file
elemNS - XML namespace (null defaults to bc4j URI)
elemName - name of element (could be 0-n). Ex: "Containee"
nvpChildName - name of direct child of elemName containing "Name", "Value" attribute pairs. Ex: "DesignTime"
Returns:
a list of elemName maps, each one with the attribute pairs, and a secondary map keyed by nvpChildName containing the nv pairs.
Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException

updateElementsInMetadataRegistry

public boolean updateElementsInMetadataRegistry(java.util.Collection<java.lang.String> relativePaths,
                                                java.util.Map<java.lang.String,java.lang.String> elementXref,
                                                java.net.URL adfmXmlUrl)
                                         throws java.io.IOException,
                                                org.xml.sax.SAXException,
                                                javax.xml.parsers.ParserConfigurationException,
                                                javax.xml.transform.TransformerConfigurationException,
                                                javax.xml.transform.TransformerException
Description copied from class: MetadataRegistry
See updateElementsInMetadataRegistryEx
Specified by:
updateElementsInMetadataRegistry in class MetadataRegistry
Returns:
Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerException

updateElementsInMetadataRegistryEx

public boolean updateElementsInMetadataRegistryEx(java.util.Collection<java.lang.String> relativePaths,
                                                  java.util.Collection<java.lang.String> removalPaths,
                                                  java.util.Map<java.lang.String,java.lang.String> elementXref,
                                                  java.net.URL adfmXmlUrl,
                                                  int[] remaining)
                                           throws java.io.IOException,
                                                  org.xml.sax.SAXException,
                                                  javax.xml.parsers.ParserConfigurationException,
                                                  javax.xml.transform.TransformerConfigurationException,
                                                  javax.xml.transform.TransformerException
Description copied from class: MetadataRegistry
Process all elements in the list of relativePaths referring to elementXref to get the elementNames corresponding to the extensions encountered. When the entries are processed and it's determined that the document has been dirtied, then the new xml is written back to the adfmXmlUrl.
Specified by:
updateElementsInMetadataRegistryEx in class MetadataRegistry
Parameters:
relativePaths - The paths to ensure added in the metadata directory
removalPaths - The paths to remove from the metadata directory. The assumption is that only one type will be responsible for a path at any given time. So it can be removed without reference to the type.
elementXref - The extension to elementName cross reference for constituent files of the metadata registry, null assumes adfm entries.
adfmXmlUrl - The output file to update if needed
remaining - pass a non-null and the [0] element will contain how many remain in the doc when method completes (from a wildcard)
Returns:
Whether the document has been dirtied by the processing
Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerException

updateRegistryElement

public boolean updateRegistryElement(java.lang.String relativePath,
                                     java.lang.String elementNS,
                                     java.lang.String elementName,
                                     org.w3c.dom.Document doc)
Description copied from class: MetadataRegistry
Update a single path attribute in the metadata registry passed as the doc param, and the elementName and elementNS are the specifics of the item to make the change on. The registry document assumes that paths are unique within a particular name and NS. For example, the DCXREGISTRY only has one element where the path is "view/DataControls.dcx".
Specified by:
updateRegistryElement in class MetadataRegistry
Parameters:
relativePath - The path attribute value to insert, or ignore
elementNS - The namespace of the elementName
elementName - The registry name
doc - The metadata document
Returns:
Whether the document has been dirtied by the processing

setBaseURL

public java.net.URL setBaseURL(java.net.URL newBaseURL)
Specified by:
setBaseURL in class MetadataRegistry
Parameters:
newBaseURL - the baseUrl the DOMParser will use to getDomDocument.
Returns:
the existing baseUrl

setValidationMode

public void setValidationMode(java.lang.Integer mode)
Description copied from class: MetadataRegistry
Sets the validation mode to use when parsing documents.
Specified by:
setValidationMode in class MetadataRegistry
Parameters:
mode - must be a valid mode from DOMParser. If this method isn't called then the parser method won't be called.

setPreserveWhitespace

public void setPreserveWhitespace(java.lang.Boolean preserve)
Description copied from class: MetadataRegistry
Sets the whitespace preservation to use when parsing documents. The default is true.
Specified by:
setPreserveWhitespace in class MetadataRegistry
Parameters:
preserve - the value to use when calling setPreserveWhitespace.

openStream

protected java.io.InputStream openStream(java.net.URL url)
                                  throws java.io.IOException
Throws:
java.io.IOException

getDomDocument

public org.w3c.dom.Document getDomDocument(java.net.URL url)
                                    throws javax.xml.parsers.ParserConfigurationException,
                                           org.xml.sax.SAXException,
                                           java.io.IOException
Description copied from class: MetadataRegistry
Parse and return the DOM document located at the URL.
Specified by:
getDomDocument in class MetadataRegistry
Parameters:
url - the document location
Returns:
the parsed document represented by the url
Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException

newDomDocument

protected org.w3c.dom.Document newDomDocument(java.net.URL url)
                                       throws javax.xml.parsers.ParserConfigurationException,
                                              java.io.IOException
Throws:
javax.xml.parsers.ParserConfigurationException
java.io.IOException

saveDocumentTo

public void saveDocumentTo(org.w3c.dom.Document doc,
                           java.net.URL saveTo)
                    throws javax.xml.transform.TransformerConfigurationException,
                           javax.xml.transform.TransformerException,
                           java.io.IOException
Description copied from class: MetadataRegistry
Causes the document passed in to be saved to the URL passed in.
Specified by:
saveDocumentTo in class MetadataRegistry
Parameters:
doc - The document desired to saved
saveTo - Where to save the document to
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerException
java.io.IOException

saveDomDocument

protected void saveDomDocument(MetadataRegistryImpl.Context ctx)
                        throws javax.xml.transform.TransformerConfigurationException,
                               javax.xml.transform.TransformerException,
                               java.io.IOException
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerException
java.io.IOException

preprocessURL

protected java.net.URL preprocessURL(java.net.URL url)
                              throws java.io.IOException
Throws:
java.io.IOException

getOutputStream

protected java.io.OutputStream getOutputStream(MetadataRegistryImpl.Context ctx)
                                        throws java.io.IOException
Throws:
java.io.IOException

getDocumentForWriting

protected void getDocumentForWriting(MetadataRegistryImpl.Context ctx)
                              throws java.io.IOException,
                                     org.xml.sax.SAXException,
                                     javax.xml.parsers.ParserConfigurationException
Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException

listFiles

public java.net.URL[] listFiles(java.net.URL url)
Specified by:
listFiles in class MetadataRegistry
Parameters:
url - The directory, jar, etc to use to get the return values. Note: implementations exist for file: and jar: unless you use the javatools-nodeps.jar in your classpath (default within ide).
Returns:
an array of URL's (files and directories) in the url param. Returns null if the URL does not represent a directory or if an I/O error occurs.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 2 (11.1.2.2.0)

E17486-03


Copyright © 1997, 2012, Oracle. All rights reserved.