Top Description Inners Constructors Methods
org.jooq.tools.reflect

pack-priv Class Compile

extends Object
Class Inheritance
Static Imports
java.lang.StackWalker.Option.RETAIN_CLASS_REFERENCE

A utility that simplifies in-memory compilation of new classes.
Author
Lukas Eder

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static interface

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static Class<?>
compile(String className, String content, CompileOptions compileOptions)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Compileback to summary
pack-priv Compile()

Method Detail

compileback to summary
pack-priv static Class<?> compile(String className, String content, CompileOptions compileOptions)
org.jooq.tools.reflect back to summary

pack-priv final Class Compile.ByteArrayClassLoader

extends ClassLoader
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Map<String, byte[]>

Constructor Summary

AccessConstructor and Description
pack-priv
ByteArrayClassLoader(Map<String, byte[]> classes)

Method Summary

Modifier and TypeMethod and Description
protected Class<?>
findClass(String
The binary name of the class
name
)

Overrides java.lang.ClassLoader.findClass.

Finds the class with the specified binary name.
Inherited from java.lang.ClassLoader:
clearAssertionStatusdefineClassdefineClassdefineClassdefineClassdefinePackagefindClassfindLibraryfindLoadedClassfindResourcefindResourcefindResourcesfindSystemClassgetClassLoadingLockgetDefinedPackagegetDefinedPackagesgetNamegetPackagegetPackagesgetParentgetPlatformClassLoadergetResourcegetResourceAsStreamgetResourcesgetSystemClassLoadergetSystemResourcegetSystemResourceAsStreamgetSystemResourcesgetUnnamedModuleisRegisteredAsParallelCapableloadClassloadClassregisterAsParallelCapableresolveClassresourcessetClassAssertionStatussetDefaultAssertionStatussetPackageAssertionStatussetSigners

Field Detail

classesback to summary
private final Map<String, byte[]> classes

Hides java.lang.ClassLoader.classes.

Constructor Detail

ByteArrayClassLoaderback to summary
pack-priv ByteArrayClassLoader(Map<String, byte[]> classes)

Method Detail

findClassback to summary
protected Class<?> findClass(String name) throws ClassNotFoundException

Overrides java.lang.ClassLoader.findClass.

Doc from java.lang.ClassLoader.findClass.

Finds the class with the specified binary name. This method should be overridden by class loader implementations that follow the delegation model for loading classes, and will be invoked by the loadClass method after checking the parent class loader for the requested class.

Parameters
name:String

The binary name of the class

Returns:Class<?>

The resulting Class object

Annotations
@Override
Exceptions
ClassNotFoundException:
If the class could not be found
org.jooq.tools.reflect back to summary

pack-priv final Class Compile.CharSequenceJavaFileObject

extends SimpleJavaFileObject
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final CharSequence
Inherited from javax.tools.SimpleJavaFileObject:
kinduri

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public CharSequence
getCharContent(boolean
ignore encoding errors if true
ignoreEncodingErrors
)

Overrides javax.tools.SimpleJavaFileObject.getCharContent.

Implements javax.tools.FileObject.getCharContent.

This implementation always throws UnsupportedOperationException.
Inherited from javax.tools.SimpleJavaFileObject:
deletegetAccessLevelgetKindgetLastModifiedgetNamegetNestingKindisNameCompatibleopenInputStreamopenOutputStreamopenReaderopenWritertoStringtoUri

Field Detail

contentback to summary
pack-priv final CharSequence content

Constructor Detail

CharSequenceJavaFileObjectback to summary
public CharSequenceJavaFileObject(String className, CharSequence content)

Method Detail

getCharContentback to summary
public CharSequence getCharContent(boolean ignoreEncodingErrors)

Overrides javax.tools.SimpleJavaFileObject.getCharContent.

Implements javax.tools.FileObject.getCharContent.

Doc from javax.tools.SimpleJavaFileObject.getCharContent.

This implementation always throws UnsupportedOperationException. Subclasses can change this behavior as long as the contract of FileObject is obeyed.

Parameters
ignoreEncodingErrors:boolean

Doc from javax.tools.FileObject.getCharContent.

ignore encoding errors if true

Returns:CharSequence

Doc from javax.tools.FileObject.getCharContent.

a CharSequence if available; null otherwise

Annotations
@Override
org.jooq.tools.reflect back to summary

pack-priv final Class Compile.ClassFileManager

extends ForwardingJavaFileManager<StandardJavaFileManager>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private Map<String, byte[]>
private final Map<String, Compile.JavaFileObject>
Inherited from javax.tools.ForwardingJavaFileManager:
fileManager

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv Map<String, byte[]>
public Compile.JavaFileObject
getJavaFileForOutput(JavaFileManager.Location
a package-oriented location
location
,
String
the name of a class
className
,
JavaFileObject.Kind
the kind of file, must be one of SOURCE or CLASS
kind
,
FileObject
a file object to be used as hint for placement; might be null
sibling
)

Overrides javax.tools.ForwardingJavaFileManager.getJavaFileForOutput.

Implements javax.tools.JavaFileManager.getJavaFileForOutput.

Returns a file object for output representing the specified class of the specified kind in the given package-oriented location.
pack-priv boolean
pack-priv Class<?>
loadAndReturnMainClass(String mainClassName, Compile.ThrowingBiFunction<String, byte[], Class<?>> definer)

Inherited from javax.tools.ForwardingJavaFileManager:
closecontainsflushgetClassLoadergetFileForInputgetFileForOutputgetFileForOutputForOriginatingFilesgetJavaFileForInputgetJavaFileForOutputForOriginatingFilesgetLocationForModulegetLocationForModulegetServiceLoaderhandleOptionhasLocationinferBinaryNameinferModuleNameisSameFileisSupportedOptionlistlistLocationsForModules

Field Detail

classesback to summary
private Map<String, byte[]> classes
fileObjectMapback to summary
private final Map<String, Compile.JavaFileObject> fileObjectMap

Constructor Detail

ClassFileManagerback to summary
pack-priv ClassFileManager(StandardJavaFileManager standardManager)

Method Detail

classesback to summary
pack-priv Map<String, byte[]> classes()
getJavaFileForOutputback to summary
public Compile.JavaFileObject getJavaFileForOutput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind, FileObject sibling)

Overrides javax.tools.ForwardingJavaFileManager.getJavaFileForOutput.

Implements javax.tools.JavaFileManager.getJavaFileForOutput.

Doc from javax.tools.JavaFileManager.getJavaFileForOutput.

Returns a file object for output representing the specified class of the specified kind in the given package-oriented location.

Optionally, this file manager might consider the sibling as a hint for where to place the output. The exact semantics of this hint is unspecified. The JDK compiler, javac, for example, will place class files in the same directories as originating source files unless a class file output directory is provided. To facilitate this behavior, javac might provide the originating source file as sibling when calling this method.

Parameters
location:JavaFileManager.Location

a package-oriented location

className:String

the name of a class

kind:JavaFileObject.Kind

the kind of file, must be one of SOURCE or CLASS

sibling:FileObject

a file object to be used as hint for placement; might be null

Returns:Compile.JavaFileObject

a file object for output

Annotations
@Override
isEmptyback to summary
pack-priv boolean isEmpty()
loadAndReturnMainClassback to summary
pack-priv Class<?> loadAndReturnMainClass(String mainClassName, Compile.ThrowingBiFunction<String, byte[], Class<?>> definer) throws Exception
org.jooq.tools.reflect back to summary

pack-priv final Class Compile.JavaFileObject

extends SimpleJavaFileObject
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final ByteArrayOutputStream
Inherited from javax.tools.SimpleJavaFileObject:
kinduri

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv byte[]
public CharSequence
getCharContent(boolean
ignore encoding errors if true
ignoreEncodingErrors
)

Overrides javax.tools.SimpleJavaFileObject.getCharContent.

Implements javax.tools.FileObject.getCharContent.

This implementation always throws UnsupportedOperationException.
public OutputStream
Inherited from javax.tools.SimpleJavaFileObject:
deletegetAccessLevelgetKindgetLastModifiedgetNamegetNestingKindisNameCompatibleopenInputStreamopenReaderopenWritertoStringtoUri

Field Detail

osback to summary
pack-priv final ByteArrayOutputStream os

Constructor Detail

JavaFileObjectback to summary
pack-priv JavaFileObject(String name, JavaFileObject.Kind kind)

Method Detail

getBytesback to summary
pack-priv byte[] getBytes()
getCharContentback to summary
public CharSequence getCharContent(boolean ignoreEncodingErrors)

Overrides javax.tools.SimpleJavaFileObject.getCharContent.

Implements javax.tools.FileObject.getCharContent.

Doc from javax.tools.SimpleJavaFileObject.getCharContent.

This implementation always throws UnsupportedOperationException. Subclasses can change this behavior as long as the contract of FileObject is obeyed.

Parameters
ignoreEncodingErrors:boolean

Doc from javax.tools.FileObject.getCharContent.

ignore encoding errors if true

Returns:CharSequence

Doc from javax.tools.FileObject.getCharContent.

a CharSequence if available; null otherwise

Annotations
@Override
openOutputStreamback to summary
public OutputStream openOutputStream()

Overrides javax.tools.SimpleJavaFileObject.openOutputStream.

Implements javax.tools.FileObject.openOutputStream.

Doc from javax.tools.SimpleJavaFileObject.openOutputStream.

This implementation always throws UnsupportedOperationException. Subclasses can change this behavior as long as the contract of FileObject is obeyed.

Returns:OutputStream

Doc from javax.tools.FileObject.openOutputStream.

an OutputStream

Annotations
@Override
org.jooq.tools.reflect back to summary

pack-priv Interface Compile.ThrowingBiFunction<T, U, R>

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public R
apply(T t, U u)

Method Detail

applyback to summary
public R apply(T t, U u) throws Exception