public static class ClassFileLocator.Compound extends Object implements ClassFileLocator
ClassFileLocator
that chains several locators.
Any class file locator is queried in the supplied order until one locator is able to provide an input
stream of the class file.ClassFileLocator.Compound, ClassFileLocator.Default
CLASS_FILE_EXTENSION
Constructor and Description |
---|
Compound(ClassFileLocator... classFileLocator)
Creates a new compound class file locator.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
classFileFor(TypeDescription typeDescription)
Locates the class file for a given type and returns the file as an input stream.
|
boolean |
equals(Object other) |
int |
hashCode() |
static ClassFileLocator |
makeDefault()
Creates a default class file locator by chaining the
ClassFileLocator.Default.ATTACHED and the
ClassFileLocator.Default.CLASS_PATH class file locator. |
String |
toString() |
public Compound(ClassFileLocator... classFileLocator)
classFileLocator
- The ClassFileLocator
s to be
represented by this compound class file locator in the order of their application.public static ClassFileLocator makeDefault()
ClassFileLocator.Default.ATTACHED
and the
ClassFileLocator.Default.CLASS_PATH
class file locator.public InputStream classFileFor(TypeDescription typeDescription)
ClassFileLocator
InputStream
is closed automatically after it is processed. If no class file can be located,
null
is returned.classFileFor
in interface ClassFileLocator
typeDescription
- The description of the type for which a class file is to be located.Copyright © 2014. All rights reserved.