|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.crispy.util.Util
Utility (helper) class.
Constructor Summary | |
Util()
|
Method Summary | |
static java.lang.String |
array2String(java.lang.Object[] pvStrArray)
|
static java.lang.Object |
createObject(java.lang.String pvObjectString)
Create a object with the reflection API. |
static javax.xml.namespace.QName |
createQNameByClass(java.lang.Class pvClass)
Create a javax.xml.namespace.QName by the class. |
static void |
createTree(java.lang.Object pvObject,
javax.swing.tree.DefaultMutableTreeNode pvRoot)
|
static void |
createTreeByCollection(java.util.Collection pvCollection,
javax.swing.tree.DefaultMutableTreeNode pvRoot,
java.lang.String pvPropertyName)
|
static void |
createTreeByMap(java.util.Map pvMap,
javax.swing.tree.DefaultMutableTreeNode pvRoot,
java.lang.String pvPropertyName)
|
static java.lang.String |
cutString(java.lang.String pvString,
java.lang.String pvCuttingString)
Cut a String on the end of a input-String. |
static java.lang.Throwable |
findDeepestThrowable(java.lang.Throwable pvThrowable)
Find the deepest Exception by nested Exception. |
static java.util.Map |
getAllPropertiesByPrefixAndSort(java.util.Properties pvProperties,
java.lang.String pvPrefix)
Get from the properites all properties, that begins with the prefix and sorted this properties to the property keys. |
static java.lang.String |
getClassNameWithOutPackage(java.lang.Class pvClass)
|
static java.lang.String |
getClassNameWithOutPackage(java.lang.String pvClassName)
|
static boolean |
initJdkLogger()
|
static boolean |
initJdkLogger(java.lang.String pvFileName)
|
static boolean |
initJdkLogger2(java.io.InputStream pvInputStream)
|
static byte[] |
inputStream2ByteArray(java.io.InputStream is)
|
static boolean |
isClassInArray(java.lang.Class[] pvClassArray,
java.lang.Class pvSearchClass)
Test as search class is exist in the class array. |
static boolean |
isPortFree(int pvPort)
Test to free port. |
static java.lang.String |
map2String(java.util.Map pvMap,
java.lang.String pvPropertyName)
|
static java.lang.String |
printArray(java.lang.Object[] pvArray)
|
static void |
printMapInfo(java.util.Map pvMap)
|
static java.lang.String |
reverse(java.lang.Class pvClass)
Reverse the package fro class. |
static java.lang.String[] |
separateHostAndPort(java.lang.String pvUrlAndPort)
Separate from url the url and the port: localhost:8080 --> http://localhost and 8080 |
static void |
visualisationTree(java.lang.Object pvObject)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Util()
Method Detail |
public static java.lang.Throwable findDeepestThrowable(java.lang.Throwable pvThrowable)
Exception e0 = new Exception (); Exception e1 = new Exception (e0); Exception eFind = findDeepestThrowable(e1); The result: eFind == e0
pvThrowable
- Root-Exception.
public static boolean isPortFree(int pvPort)
pvPort
- tested port
true
, if the port is free, else false
.public static java.lang.String[] separateHostAndPort(java.lang.String pvUrlAndPort)
localhost:8080 --> http://localhost and 8080
pvUrlAndPort
-
public static java.lang.String cutString(java.lang.String pvString, java.lang.String pvCuttingString)
rmi://localhost:1099/
, Cutting-String /
, New-String rmi://localhost:1099
.
pvString
- Input-StringpvCuttingString
- Cutting-String
public static java.lang.Object createObject(java.lang.String pvObjectString) throws java.lang.Exception
pvObjectString
- String from the object.
java.lang.Exception
public static boolean isClassInArray(java.lang.Class[] pvClassArray, java.lang.Class pvSearchClass)
pvClassArray
- class arraypvSearchClass
- search class
true
, else false
public static java.lang.String printArray(java.lang.Object[] pvArray)
public static java.lang.String array2String(java.lang.Object[] pvStrArray)
public static void printMapInfo(java.util.Map pvMap)
public static java.lang.String getClassNameWithOutPackage(java.lang.Class pvClass)
public static java.lang.String getClassNameWithOutPackage(java.lang.String pvClassName)
public static java.lang.String reverse(java.lang.Class pvClass)
test.crispy.example.model.Kunde
-> model.example.crispy.test
.
By a class without a package, is the return value a empty String.
pvClass
-
public static javax.xml.namespace.QName createQNameByClass(java.lang.Class pvClass)
javax.xml.namespace.QName
by the class. For example
class: test.crispy.example.model.Kunde
->
LocalPart: test.crispy.example.model.Kunde
and
NamespaceURI: model.example.crispy.test
.
pvClass
- The class for create a QName.
public static java.util.Map getAllPropertiesByPrefixAndSort(java.util.Properties pvProperties, java.lang.String pvPrefix)
pvProperties
- all propertiespvPrefix
- filter = prefix from property key
public static byte[] inputStream2ByteArray(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public static void visualisationTree(java.lang.Object pvObject)
public static void createTree(java.lang.Object pvObject, javax.swing.tree.DefaultMutableTreeNode pvRoot)
public static java.lang.String map2String(java.util.Map pvMap, java.lang.String pvPropertyName)
public static void createTreeByMap(java.util.Map pvMap, javax.swing.tree.DefaultMutableTreeNode pvRoot, java.lang.String pvPropertyName)
public static void createTreeByCollection(java.util.Collection pvCollection, javax.swing.tree.DefaultMutableTreeNode pvRoot, java.lang.String pvPropertyName)
public static boolean initJdkLogger()
public static boolean initJdkLogger(java.lang.String pvFileName)
public static boolean initJdkLogger2(java.io.InputStream pvInputStream)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |