|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bm.utils.Ejb3Utils
public final class Ejb3Utils
Util class for ejb3unit.
| Field Summary | |
|---|---|
static int |
OSTYPE_LINUX
This field is used to OSTYPE_LINUX. |
static int |
OSTYPE_MAC
This field is used to OSTYPE_MAC. |
static int |
OSTYPE_NETWARE
This field is used to OSTYPE_NETWARE. |
static int |
OSTYPE_OS2
This field is used to OSTYPE_OS2. |
static int |
OSTYPE_SOLARIS
This field is used to OSTYPE_SOLARIS. |
static int |
OSTYPE_SUN
This field is used to OSTYPE_SUN. |
static int |
OSTYPE_UNKNOWN
This field is used to OSTYPE_UNKNOWN. |
static int |
OSTYPE_WINCE
This field is used to OSTYPE_WINCE. |
static int |
OSTYPE_WINDOWS
This field is used to OSTYPE_WINDOWS. |
static int |
OSTYPE_WINNT
This field is used to OSTYPE_WINNT. |
| Method Summary | ||
|---|---|---|
static java.lang.reflect.Field[] |
getAllFields(java.lang.Class forClass)
Returns all fields (including fields from all superclasses) of a class. |
|
static java.lang.reflect.Method[] |
getAllMethods(java.lang.Class forClass)
Returns all fields (including fields from all superclasses) of a class. |
|
static java.lang.String |
getDecodedFilename(java.net.URL url)
Decodes an encoded file name in url |
|
static GeneratorType |
getGeneratorTypeAnnotation(Generator actGenerator)
Returns a generator type for a given generator. |
|
static java.util.List<java.lang.Class> |
getLocalRemoteInterfaces(java.lang.Class toAnalyse)
Returns all business (local, remote) interfaces of the class. |
|
static
|
getNewInstance(java.lang.Class<T> forClass)
Creates a new instance of a bean, even if it's protected constructor. |
|
static java.lang.Class |
getNonPrimitiveType(java.lang.Class aktField)
This method will do the transformation of primitive types if necessary. |
|
static java.lang.Class |
getNonPrimitiveType(Property aktField)
This method will do the transformation of primitive types if necessary. |
|
static int |
getOs()
Determines the OS. |
|
static java.lang.String |
getPackageName(java.lang.String longClassName)
Return a short class name. |
|
static java.lang.reflect.Method |
getParameterlessMethodByName(java.lang.String name,
java.lang.Class inClass)
Returns a parameterless method. |
|
static java.util.Collection |
getRightCollectionType(Property forProperty)
Returns the right collection type for the given property. |
|
static java.io.File |
getRootPackageDir(java.io.File location,
java.lang.String longPackageName)
Returns the root package directory e.g com.ejb3unit.eg --> returns com. |
|
static java.lang.String |
getShortClassName(java.lang.Class clazz)
Return a short class name. |
|
static java.lang.String |
getShortClassName(java.lang.String longClassName)
Return a short class name. |
|
static java.io.File |
getTempDirectory()
Returns a path to an temp directory. |
|
static boolean |
hasSuperclassOrInterface(java.lang.Class toCheck,
java.lang.Class superclassOrInterface)
Checks if the current class inherits form the specified class. |
|
static java.lang.String |
isolateJarName(java.net.URL fileInJar)
Isolates a jar file when a file was found inside a jar. |
|
static java.util.List<java.lang.String> |
scanFileNamesInArchive(java.io.InputStream in)
Scan for files in jar file. |
|
static java.io.InputStream |
unjar(java.io.InputStream in)
Extract the first entry in the jar file to an output stream. |
|
static java.util.List<java.io.File> |
unjar(java.io.InputStream in,
java.io.File dest)
Dump the contents of a JarArchive to the specified destination. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int OSTYPE_WINDOWS
public static final int OSTYPE_WINNT
public static final int OSTYPE_WINCE
public static final int OSTYPE_LINUX
public static final int OSTYPE_MAC
public static final int OSTYPE_SOLARIS
public static final int OSTYPE_SUN
public static final int OSTYPE_NETWARE
public static final int OSTYPE_OS2
public static final int OSTYPE_UNKNOWN
| Method Detail |
|---|
public static java.lang.String isolateJarName(java.net.URL fileInJar)
fileInJar - -
the path to the file inside the jar file
public static java.lang.String getDecodedFilename(java.net.URL url)
url - the file name
public static <T> T getNewInstance(java.lang.Class<T> forClass)
T - forClass - for which class
public static int getOs()
public static java.util.List<java.io.File> unjar(java.io.InputStream in,
java.io.File dest)
throws java.io.IOException
in - -
the jar archive as input streamdest - -
the destination (to extract the content)
java.io.IOException - -
in an error case
public static java.io.InputStream unjar(java.io.InputStream in)
throws java.io.IOException
in - -
the jar archive as input stream
java.io.IOException - -
in an error case
public static java.util.List<java.lang.String> scanFileNamesInArchive(java.io.InputStream in)
throws java.io.IOException
in - -
the jar archive as input stream
java.io.IOException - -
in an error casepublic static java.util.List<java.lang.Class> getLocalRemoteInterfaces(java.lang.Class toAnalyse)
toAnalyse - -
the session bean /service to analyse
public static java.lang.Class getNonPrimitiveType(Property aktField)
aktField - -
the field to inspect
public static java.lang.Class getNonPrimitiveType(java.lang.Class aktField)
aktField - -
the field to inspect
public static boolean hasSuperclassOrInterface(java.lang.Class toCheck,
java.lang.Class superclassOrInterface)
toCheck - the class to checksuperclassOrInterface - the superclass
public static GeneratorType getGeneratorTypeAnnotation(Generator actGenerator)
actGenerator - -
given generator
public static java.util.Collection getRightCollectionType(Property forProperty)
forProperty - -
for which property
public static java.lang.reflect.Field[] getAllFields(java.lang.Class forClass)
forClass - -
for which class
public static java.lang.reflect.Method getParameterlessMethodByName(java.lang.String name,
java.lang.Class inClass)
name - the name of the methodinClass - in which class
public static java.lang.reflect.Method[] getAllMethods(java.lang.Class forClass)
forClass - -
for which class
public static java.lang.String getShortClassName(java.lang.String longClassName)
longClassName - -
the long fully qualified calss name
public static java.lang.String getPackageName(java.lang.String longClassName)
longClassName - -
the long fully qualified class name
public static java.io.File getRootPackageDir(java.io.File location,
java.lang.String longPackageName)
location - -
the location of the packagelongPackageName - -
the long fully qualified class name
public static java.lang.String getShortClassName(java.lang.Class clazz)
clazz - -
for class
public static java.io.File getTempDirectory()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||