Interface ClassSource
- 
- All Known Subinterfaces:
- ClassSource_Aggregate,- ClassSource_ClassLoader,- ClassSource_MappedContainer,- ClassSource_MappedDirectory,- ClassSource_MappedJar,- ClassSource_MappedSimple
 
 public interface ClassSource
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringCLASS_EXTENSIONConstant extension for class resource names.static charCLASS_SEPARATOR_CHARConstant class name separation character.static charINNER_CLASS_SEPARATORConstant for inner classes.static charRESOURCE_SEPARATOR_CHARConstant resource separation character.static java.lang.StringRESOURCE_SEPARATOR_STRINGConstant resource separation string.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Close the class source.voidcloseClassStream(java.lang.String className, java.io.InputStream inputStream)Class the input stream which was opened for a specified class.voidcloseResourceStream(java.lang.String className, java.lang.String resourceName, java.io.InputStream inputStream)Class the input stream which was opened for a specified class.java.lang.StringgetCanonicalName()Answer the canonical name of the class source.intgetClassExclusionCount()Answer the count of class resources which were excluded as duplicates resources for the same class.intgetClassInclusionCount()Answer the count of class resources for distinct classes.java.lang.StringgetClassNameFromResourceName(java.lang.String resourceName)Convert a resource name to a class name.ClassSource_FactorygetFactory()The factory used to create this class source.java.lang.StringgetHashText()A string representation of the class source suitable for logging.Util_InternMapgetInternMap()Answer the string intern map of the class source.java.lang.StringgetName()A name for this class source.ClassSource_OptionsgetOptions()Answer the options of the class source.ClassSourcegetParentSource()Answer the parent of this class source.intgetResourceExclusionCount()Answer the count of resources which were excluded from processing because they were not class resources.java.lang.StringgetResourceNameFromClassName(java.lang.String className)Convert a class name to a resource name.intgetResult(ClassSource_ScanCounts.ResultField resultField)Answer a specific field from the scan results table.ClassSource_ScanCountsgetScanResults()Answer statistics for a scan processing.java.lang.StringinconvertResourceName(java.lang.String externalResourceName)Optional API for processing which uses an alternate form for resources.booleanisClassResource(java.lang.String resourceName)Tell if a specified resource is a class resource.booleanisDirectoryResource(java.lang.String resourceName)Tell if a specified resource is a directory resource.booleanisProcessedUsingJandex()voidlog(com.ibm.websphere.ras.TraceComponent logger)Log state information for the class source to a specified logger.voidlogState()Log state information for the class source.voidopen()Open the class source for use.java.io.InputStreamopenClassStream(java.lang.String className)Open an input stream for a named class.java.io.InputStreamopenResourceStream(java.lang.String className, java.lang.String resourceName)Open an input stream for a named class which has a specified resource name.java.lang.StringoutconvertResourceName(java.lang.String internalResourceName)Optional API for processing which uses an alternate form for resources.java.lang.StringresourceAppend(java.lang.String head, java.lang.String tail)Perform a resource append operation: This places a resource separator between the supplied values.voidscanClasses(ClassSource_Streamer streamer, java.util.Set<java.lang.String> i_seedClassNamesSet, ClassSource_Aggregate.ScanPolicy scanPolicy)Entry point for scanning a class source which is a child of an aggregate class source.booleanscanReferencedClass(java.lang.String referencedClassNam, ClassSource_Streamer streamer)Required entry point for scans of referenced classes.booleanscanSpecificSeedClass(java.lang.String specificClassName, ClassSource_Streamer streamer)Alternate scan processing step: Perform scanning only on specific class.voidsetParentSource(ClassSource classSource)Set the parent of this class source.
 
- 
- 
- 
Field Detail- 
RESOURCE_SEPARATOR_CHARstatic final char RESOURCE_SEPARATOR_CHAR Constant resource separation character. - See Also:
- Constant Field Values
 
 - 
RESOURCE_SEPARATOR_STRINGstatic final java.lang.String RESOURCE_SEPARATOR_STRING Constant resource separation string. - See Also:
- Constant Field Values
 
 - 
CLASS_SEPARATOR_CHARstatic final char CLASS_SEPARATOR_CHAR Constant class name separation character. - See Also:
- Constant Field Values
 
 - 
CLASS_EXTENSIONstatic final java.lang.String CLASS_EXTENSION Constant extension for class resource names. - See Also:
- Constant Field Values
 
 - 
INNER_CLASS_SEPARATORstatic final char INNER_CLASS_SEPARATOR Constant for inner classes. - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getHashTextjava.lang.String getHashText() A string representation of the class source suitable for logging. The hash text should include a unique identifier (usually the base hash code of the class source) plus the most relevant descriptive information for the class source. - Returns:
- A string representation of the class source suitable for logging.
 
 - 
logStatevoid logState() Log state information for the class source. 
 - 
logvoid log(com.ibm.websphere.ras.TraceComponent logger) Log state information for the class source to a specified logger. State information uses 'debug' log enablement. - Parameters:
- logger- A logger which is to receive state information.
 
 - 
getFactoryClassSource_Factory getFactory() The factory used to create this class source. Other factory based objects created by the class source will use this factory. - Returns:
- The factory used to create this class source.
 
 - 
getParentSourceClassSource getParentSource() Answer the parent of this class source. Answer null if none is set. - Returns:
- The parent of this class source.
 
 - 
setParentSourcevoid setParentSource(ClassSource classSource) Set the parent of this class source. - Parameters:
- parent- The parent of this class source.
 
 - 
getNamejava.lang.String getName() A name for this class source. The class source name is used as a unique ID when storing values to annotation targets. See com.ibm.wsspi.anno.targets.AnnotationTargets_Targets#getClassSourceNames().When adding class sources to an aggregate, the names of the child class sources must be unique. - Returns:
- A name for this class source.
 
 - 
getCanonicalNamejava.lang.String getCanonicalName() Answer the canonical name of the class source. All use of the class source uses the canonical name. - Returns:
- The canonical name of the class source.
- See Also:
- ClassSource_Factory.getCanonicalName(String)
 
 - 
getOptionsClassSource_Options getOptions() Answer the options of the class source.- Returns:
- The options of the class source.
 
 - 
openvoid open() throws ClassSource_Exception Open the class source for use. This will open any underlying objects.- Throws:
- ClassSource_Exception- Thrown if the class source could not be opened.
 
 - 
closevoid close() throws ClassSource_ExceptionClose the class source. Close any underlying objects.- Throws:
- ClassSource_Exception- Thrown if the class source could not be closed.
 
 - 
getInternMapUtil_InternMap getInternMap() Answer the string intern map of the class source. Class sources intern all class names of scanned classes. - Returns:
- The intern map of the class source.
 
 - 
scanClassesvoid scanClasses(ClassSource_Streamer streamer, java.util.Set<java.lang.String> i_seedClassNamesSet, ClassSource_Aggregate.ScanPolicy scanPolicy) Entry point for scanning a class source which is a child of an aggregate class source. - Parameters:
- streamer- A selection and processing helper for the scan operation.
- i_seedClassNamesSet- The accumulated seed class names.
- scanPolicy- The scan policy of the class source (recorded by the parent).
 
 - 
getScanResultsClassSource_ScanCounts getScanResults() Answer statistics for a scan processing. (These are only available after scanning is complete.) - Returns:
- Statistics for scan processing.
 
 - 
getResultint getResult(ClassSource_ScanCounts.ResultField resultField) Answer a specific field from the scan results table. - Parameters:
- resultField- The scan results field which is to be retrieved.
- Returns:
- The value of the requested scan results field.
 
 - 
scanSpecificSeedClassboolean scanSpecificSeedClass(java.lang.String specificClassName, ClassSource_Streamer streamer) throws ClassSource_ExceptionAlternate scan processing step: Perform scanning only on specific class. - Parameters:
- specificClassNamesThe- name of the class which is to be scanned.
- streamer- A selection and processing helper for the scan operation.
- Returns:
- True if the streamer processed the class. Otherwise, false.
- Throws:
- ClassSource_Exception- Thrown in case of an error during scan processing.
 
 - 
scanReferencedClassboolean scanReferencedClass(java.lang.String referencedClassNam, ClassSource_Streamer streamer) throws ClassSource_ExceptionRequired entry point for scans of referenced classes. - Parameters:
- referencedClassNam- The names of a referenced classes which requires scanning.
- streamer- A selection and processing helper for the scan operation.
- Returns:
- True if the streamer processed the class. Otherwise, false.
- Throws:
- ClassSource_Exception- Thrown in case of an error during scan processing.
 
 - 
resourceAppendjava.lang.String resourceAppend(java.lang.String head, java.lang.String tail)Perform a resource append operation: This places a resource separator between the supplied values. - Parameters:
- head- The first value to put into the concatenated value.
- tail- The second value to put into the concatenated value.
- Returns:
- The first value concatenated with a resource separator and with the second value.
 
 - 
isDirectoryResourceboolean isDirectoryResource(java.lang.String resourceName) Tell if a specified resource is a directory resource. Resources which end with the resource separator are directory resources. - Parameters:
- resourceName- The resource name to test.
- Returns:
- True if the resource is a directory resource. Otherwise, false.
 
 - 
isClassResourceboolean isClassResource(java.lang.String resourceName) Tell if a specified resource is a class resource. A resource is a class resource if and only if it has the class extension. - Parameters:
- resourceName- The resource which is to be tested.
- Returns:
- True if the resource is a class resource. Otherwise, false.
 
 - 
getClassNameFromResourceNamejava.lang.String getClassNameFromResourceName(java.lang.String resourceName) Convert a resource name to a class name. Conversion strips the class extension and converts all resource separators to class separators. Note that the inner class separator is not changed by the conversion. - Parameters:
- resourceName- The resource to convert to a class name.
- Returns:
- The class name for the resource.
 
 - 
getResourceNameFromClassNamejava.lang.String getResourceNameFromClassName(java.lang.String className) Convert a class name to a resource name. Conversion changes the class separator to the resource separator and adds the class extension. The inner class separator is not changed by the conversion. - Parameters:
- className- The class name to convert to a resource.
- Returns:
- The resource for the class name.
 
 - 
inconvertResourceNamejava.lang.String inconvertResourceName(java.lang.String externalResourceName) Optional API for processing which uses an alternate form for resources. For example, directory based processing may change the resource separator to a platform specific separator. - Parameters:
- externalResourceName- The external form of the resource.
- Returns:
- The internal form of the resource.
 
 - 
outconvertResourceNamejava.lang.String outconvertResourceName(java.lang.String internalResourceName) Optional API for processing which uses an alternate form for resources. For example, directory based processing may change the resource separator to a platform specific separator. - Parameters:
- internalResourceName- The internal form of the resource.
- Returns:
- The external form of the resource.
 
 - 
openClassStreamjava.io.InputStream openClassStream(java.lang.String className) throws ClassSource_ExceptionOpen an input stream for a named class. Note the distinct cases: If no resource is available for the class, answer null. If a resource is available but cannot be opened, throw an exception. - Parameters:
- className- The name of the class for which to open an input stream.
- Returns:
- The input stream for the named class. Null if no resource is available for the class.
- Throws:
- ClassSource_Exception- Thrown in case a resource is available for the class, but that resource could not be opened.
 
 - 
openResourceStreamjava.io.InputStream openResourceStream(java.lang.String className, java.lang.String resourceName) throws ClassSource_ExceptionOpen an input stream for a named class which has a specified resource name. This code point is exposed to minimize class name to resource name conversion: Processing which prefers to use the resource name will generate a class name, but should not be forced to discard the resource name. Note the distinct cases: If no resource is available for the class, answer null. If a resource is available but cannot be opened, throw an exception. - Parameters:
- className- The name of the class for which to open an input stream.
- Returns:
- The input stream for the named class. Null if no resource is available for the class.
- Throws:
- ClassSource_Exception- Thrown in case a resource is available for the class, but that resource could not be opened.
 
 - 
closeClassStreamvoid closeClassStream(java.lang.String className, java.io.InputStream inputStream) throws ClassSource_ExceptionClass the input stream which was opened for a specified class. - Parameters:
- className- The class for which the input stream was opened.
- inputStream- The input stream which is to be closed.
- Throws:
- ClassSource_Exception- Thrown in case the input stream could not be closed.
 
 - 
closeResourceStreamvoid closeResourceStream(java.lang.String className, java.lang.String resourceName, java.io.InputStream inputStream) throws ClassSource_ExceptionClass the input stream which was opened for a specified class. This code point is exposed to minimize class name to resource name conversion: Processing which prefers to use the resource name will generate a class name, but should not be forced to discard the resource name. - Parameters:
- className- The class for which the input stream was opened.
- inputStream- The input stream which is to be closed.
- Throws:
- ClassSource_Exception- Thrown in case the input stream could not be closed.
 
 - 
getResourceExclusionCountint getResourceExclusionCount() Answer the count of resources which were excluded from processing because they were not class resources. This includes all container resources and all resources which do not have the class extension. - Returns:
- The count of resources excluded from processing as non-class resources.
- See Also:
- isClassResource(String)
 
 - 
getClassExclusionCountint getClassExclusionCount() Answer the count of class resources which were excluded as duplicates resources for the same class. For example, an aggregate class source may contain a resource for the same class in two different child class sources. Only one of these is processed; the others are excluded and will contribute to the exclusion count. Class resources skipping by the stream are not included in this count. The class inclusion count plus the class exclusion count add up to the count of all class resources encountered during processing. Classes from non-seed class sources are not included in either statistic. - Returns:
- The count of class resources for duplicate classes.
- See Also:
- getClassInclusionCount(),- isClassResource(String),- ClassSource_Streamer#doProcess(String)
 
 - 
getClassInclusionCountint getClassInclusionCount() Answer the count of class resources for distinct classes. For example, an aggregate class source may contain a resource for the same class in two different child class sources. The class inclusion count is incremented just once for the entire set of duplicating class resources. The exclusion count is incremented once for each of the other duplicating class resources. Class resources skipping by the stream are not included in this count. - Returns:
- The count of class resources for distinct classes.
- See Also:
- getClassExclusionCount(),- isClassResource(String),- ClassSource_Streamer#doProcess(String)
 
 - 
isProcessedUsingJandexboolean isProcessedUsingJandex() 
 
- 
 
-