org.jenkinsci.constant_pool_scanner

## Class ConstantPoolScanner

- java.lang.Object
- - org.jenkinsci.constant_pool_scanner.ConstantPoolScanner

    public class ConstantPoolScanner
    extends Object

Streaming parser of the constant pool in a Java class file. This might be used for dependency analysis, class loader optimizations, etc.

See Also:
  original sources

### Method Summary

Methods
`static Set<String>` `dependencies(byte[] data)` Examines the constant pool of a class file and looks for references to other classes.
`static Set<String>` `dependencies(InputStream in)` Examines the constant pool of a class file and looks for references to other classes.
`static ConstantPool` `parse(byte[] source, ConstantType... types)` Parses a class file and invokes the visitor with constants.
`static ConstantPool` `parse(DataInput s, Collection<ConstantType> _collect)` Parses a class file and invokes the visitor with constants.
`static ConstantPool` `parse(InputStream source, ConstantType... types)` Parses a class file and invokes the visitor with constants.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### dependencies

    public static Set<String> dependencies(byte[] data)
                                    throws IOException

Examines the constant pool of a class file and looks for references to other classes.

Parameters:
  `data` - a Java class file
Returns:
  a (sorted) set of binary class names (e.g. `some.pkg.Outer$Inner`)
Throws:
  `IOException` - in case of malformed bytecode

#### dependencies

    public static Set<String> dependencies(InputStream in)
                                    throws IOException

Examines the constant pool of a class file and looks for references to other classes.

Parameters:
  `in` - Stream that reads a Java class file
Returns:
  a (sorted) set of binary class names (e.g. `some.pkg.Outer$Inner`)
Throws:
  `IOException` - in case of malformed bytecode

#### parse

    public static ConstantPool parse(byte[] source,
                     ConstantType... types)
                              throws IOException

Parses a class file and invokes the visitor with constants.

Throws:
  `IOException`

#### parse

    public static ConstantPool parse(InputStream source,
                     ConstantType... types)
                              throws IOException

Parses a class file and invokes the visitor with constants.

Throws:
  `IOException`

#### parse

    public static ConstantPool parse(DataInput s,
                     Collection<ConstantType> _collect)
                              throws IOException

Parses a class file and invokes the visitor with constants.

Throws:
  `IOException`