Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 1 (11.1.1.6.0)

E10686-07

oracle.adf.share.services
Interface DescriptorContext

All Known Implementing Classes:
DefaultDescriptorContext

public interface DescriptorContext


Method Summary
 java.lang.String getJarFileName()
           
 java.lang.String getJarName()
           
 java.net.URL getJarURL()
           
 java.util.jar.Manifest getManifest()
           
 javax.naming.Context getNamingContext()
           
 java.lang.String getString(java.util.Collection<java.lang.String> descriptorNames, java.lang.String suffix)
           
 java.lang.String getString(java.lang.String[] descriptorNames, java.lang.String suffix)
           
 boolean isDescriptorVisible(java.util.Collection<java.lang.String> names, boolean checkParents)
           
 boolean isDescriptorVisible(java.lang.String[] names, boolean checkParents)
          See overloaded method.
 boolean isPackageVisible(java.lang.String packageName, boolean checkParents)
          Scan all manifest relevant packages (including the main one) and bundles to determine if any rule causes the package to be made explicitly visible or not.
 boolean jarExists()
           
 

Method Detail

getJarURL

java.net.URL getJarURL()
Returns:
the jar URL or null if this context is not associated with a jar (i.e. the 'root' or classloader context).

jarExists

boolean jarExists()
Returns:
true if there is a jar associated, and it's know to exist.

getString

java.lang.String getString(java.util.Collection<java.lang.String> descriptorNames,
                           java.lang.String suffix)
                           throws java.io.IOException
Parameters:
descriptorNames - components of the bundle key to build
suffix - see oracle.adf.share.services.DescriptorConstants.ALL_SUFFIXES
Returns:
the first non-null matching key value in the Bundle-Classes list.

The key will likely have 2 parts:

"ADF_DataControl", "model/AppModule", and the suffix part (ex: "name")

Throws:
java.io.IOException - if jar access fails (getLastModified, getManifest, etc)

getString

java.lang.String getString(java.lang.String[] descriptorNames,
                           java.lang.String suffix)
                           throws java.io.IOException
Parameters:
descriptorNames -
suffix -
Returns:
Throws:
java.io.IOException - if jar access fails (getLastModified, getManifest, etc)
See Also:
getString(Collection descriptorNames, String suffix)

getJarName

java.lang.String getJarName()
                            throws java.io.IOException
Returns:
The most appropriate display name for the jar in context. The following algorithm is used (in this order):
  1. If the jar has Bundle-Classes in the main manifest attributes, they will be checked (in declaration order) for the ".name" key.
  2. The main manifest "Implementation-Title" attribute is used.
  3. The main manifest "Specification-Title" attribute is used.
  4. The "base name" of the jar is returned (i.e. no path names).
Throws:
java.io.IOException

getJarFileName

java.lang.String getJarFileName()
                                throws java.io.IOException
Returns:
The name of the jar file excluding the path.
Throws:
java.io.IOException

isPackageVisible

boolean isPackageVisible(java.lang.String packageName,
                         boolean checkParents)
                         throws java.io.IOException
Scan all manifest relevant packages (including the main one) and bundles to determine if any rule causes the package to be made explicitly visible or not. The default is visible if no matching specifications found.

Parameters:
packageName - null or empty string for the main jar manifest attribute (and resource bundles). Otherwise, the packageName to check for "Design-Visibility" in the jar manifest. If the value has multiple elements (separated by either '/' or '.') then the following rules apply:
  1. 1. If the exact package name is declared in the manifest then it's used
  2. 2. If any parent (in reverse order) has a declared value then it's used
checkParents - Passing false will disable the inheritance checking described here and just check the currently requested package.
Returns:
true if there is no declaration of visibility at all for either the packageName parameter or any of it's parents. If there is an explicit declaration then that value is returned (using the rules in packageName).
Throws:
java.io.IOException

isDescriptorVisible

boolean isDescriptorVisible(java.util.Collection<java.lang.String> names,
                            boolean checkParents)
                            throws java.io.IOException
Parameters:
names -
checkParents -
Returns:
Throws:
java.io.IOException

isDescriptorVisible

boolean isDescriptorVisible(java.lang.String[] names,
                            boolean checkParents)
                            throws java.io.IOException
See overloaded method.

Parameters:
names -
checkParents -
Returns:
Throws:
java.io.IOException

getManifest

java.util.jar.Manifest getManifest()
                                   throws java.io.IOException
Returns:
the manifest of the current jar file in context. May be null if the jar has no manifest.
Throws:
java.io.IOException

getNamingContext

javax.naming.Context getNamingContext()
Returns:
the associated jndi naming context object.

Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 1 (11.1.1.6.0)

E10686-07

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