Class ClassFile
java.lang.Object
org.springframework.core.test.tools.ClassFile
In memory representation of a Java class.
- Since:
- 6.0
- Author:
- Stephane Nicoll
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Return the bytecode content.getName()
Return the fully qualified name of the class.static ClassFile
Factory method to create a newClassFile
from the givencontent
.static ClassFile
of
(String name, InputStreamSource inputStreamSource) Factory method to create a newClassFile
from the givenInputStreamSource
.static String
toClassName
(String path) Return the name of a class based on its relative path.
-
Method Details
-
getName
Return the fully qualified name of the class.- Returns:
- the class name
-
getContent
public byte[] getContent()Return the bytecode content.- Returns:
- the class content
-
of
Factory method to create a newClassFile
from the givencontent
.- Parameters:
name
- the fully qualified name of the classcontent
- the bytecode of the class- Returns:
- a
ClassFile
instance
-
of
Factory method to create a newClassFile
from the givenInputStreamSource
.- Parameters:
name
- the fully qualified name of the classinputStreamSource
- the bytecode of the class- Returns:
- a
ClassFile
instance
-
toClassName
Return the name of a class based on its relative path.- Parameters:
path
- the path of the class- Returns:
- the class name
-