|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.cbse.jeasy.JEUtil
public class JEUtil
A few basic functions used by the JEObjects.
| Field Summary | |
|---|---|
static java.util.Comparator |
stringCmp
A Comperator used for sorting a list. |
| Constructor Summary | |
|---|---|
JEUtil()
|
|
| Method Summary | |
|---|---|
static java.awt.Point |
adjustLocationToScreen(java.awt.Component cmp,
int xposition,
int yposition)
To position a component always inside the screen. |
byte[] |
compress(byte[] ba)
|
byte[] |
compress(byte[] ba,
javax.crypto.Cipher ec)
|
byte[] |
compress(java.lang.String s)
|
byte[] |
compress(java.lang.String s,
javax.crypto.Cipher ec)
|
static boolean |
copyFile(java.lang.String source,
java.lang.String destination)
copy a file |
void |
customizeObject(java.lang.String s)
An easy XML interface to customize JEasy objects. |
byte[] |
decompress(byte[] ba)
|
java.lang.String |
decompress(java.io.InputStream in)
|
java.lang.String |
decompress(java.io.InputStream in,
javax.crypto.Cipher dc)
|
byte[] |
decrypt(byte[] ba,
javax.crypto.Cipher decryptCipher)
|
static boolean |
deleteFile(java.lang.String source)
delete a file or (empty) directory |
byte[] |
encrypt(byte[] ba,
javax.crypto.Cipher encryptCipher)
|
static boolean |
existsFile(java.lang.String source)
tests if a file exists |
static java.lang.String |
f2str(java.lang.String source)
Reads a file into a String |
static java.lang.String |
getDateTime()
Gets a formatted date time in format yyyy-MM-dd HH:mm:ss.S |
static java.lang.String |
getDateTime(java.lang.String format)
Gets a formatted date time String Example yyyy-MM-dd HH:mm:ss.S --> 2006-11-26 17:13:26.143 |
static java.lang.String |
getFormattedSum(java.util.Vector v)
Reads Strings of a vector and tries to build a formattad sum The method should build a sum out of formatted values and a String behind example 1.234,56 EUR or 1,234.56 $ |
static java.util.Hashtable |
getHashtable()
Gets the static Hashtable |
static JEObject |
getJO(java.lang.String s)
Gets a jeasy object out of the hashtable und prints a warning out of the console |
static JEObject |
getJO(java.lang.String s,
boolean quiet)
Gets a jeasy object out of the hashtable und prints a warning out of the console if quiet is false |
static javax.swing.JLayeredPane |
getLayeredPane()
Gets the JLayeredPane of the main frame |
static java.lang.String |
getMemory()
|
static java.lang.String |
getMemory(java.lang.String label)
Gets the used memorys |
static JECallBack |
getRegisteredJECallBack(java.lang.String jeasyId)
Gets the JECallBack object that is registered to the given JEasy object or his parent |
static javax.swing.JRootPane |
getRootPane()
Gets the JRootpane of the main frame or if it is an applet of the main panel |
static java.util.Vector |
getSeparatedList(java.util.Vector v,
java.lang.String entries,
java.lang.String separator)
Appends the entries out of a string separated by separator string to a vector or creates a new vector |
static java.lang.String |
getXMLElement(java.lang.String source,
java.lang.String element)
Parses the String for the given XML-Element inside |
static java.lang.String[] |
getXMLElementArray(java.lang.String source,
java.lang.String element)
Parses the String for the given XML-Elements and returns a String array |
static java.lang.String |
getXMLElementAttribute(java.lang.String source,
java.lang.String attribut)
Parses the String for the attribut (attribut="value") inside the the given String inside |
static java.lang.String |
getXMLElementAttribute(java.lang.String source,
java.lang.String element,
java.lang.String attribut)
Parses the String for the attribut inside the the given XML-Element inside |
static java.lang.String |
getXMLElementByAttributeValue(java.lang.String source,
java.lang.String element,
java.lang.String attribute,
java.lang.String value)
Parses the String for the given XML-Elements. |
static java.lang.String |
getXMLElementNoReplace(java.lang.String source,
java.lang.String element)
Parses the String for the given XML-Element inside |
static java.util.Vector |
getXMLElementVector(java.lang.String source,
java.lang.String element)
Parses the String for the given XML-Elements and returns a vector with all text between te starttag and the endtag |
static java.util.Vector |
getXMLElementVectorNoReplace(java.lang.String source,
java.lang.String element)
Parses the String for the given XML-Elements and returns a vector with all text between te starttag and the endtag The special charcters begunning with &...; are not replaced |
static java.util.Vector |
getXMLTagVector(java.lang.String source,
java.lang.String tagname)
Parses the String for the given XML-Tagname and returns a vector with a string containing the starttag with attributes, the element and the endtag |
static java.util.Vector |
getXMLVector(java.lang.String source,
java.lang.String tag,
java.lang.String innerTag)
Searches the source for the element with the given tag and parses it for the given XML-Elements innertag and returns a vector with all text between the start-innertag and the end-innertag |
static java.lang.Object |
invoke(JEObject jo,
java.lang.String function,
java.lang.Object[] oa)
|
static java.lang.Object |
invokeAll(JEObject jeo,
java.lang.String function,
java.lang.Object[] oa,
java.lang.Object until)
Invokes a method for all components of an object until return equals "until" |
static java.lang.String |
is2s(java.io.InputStream is)
Reads an InputStream into a String and appends a after each line |
static java.lang.String |
isr2str(java.io.InputStreamReader isr)
Reads all char out of an InputStreamReader to a string |
static java.lang.String |
it(java.lang.String tag,
java.lang.String value)
returns an xml element with tag and value |
static java.lang.String |
itt(java.lang.String tag,
java.lang.String value)
returns an xml element with tag and value if value ! |
static java.lang.String |
itv(java.lang.String tagroot,
java.lang.String tagelement,
java.util.Vector v)
returns an xml element with tagroot and a number of tagelement containig the string in the vector |
static java.lang.String |
l2s(java.io.BufferedReader din,
java.lang.String end)
Reads lines in din until end was found. |
static java.lang.String |
l2s(java.io.BufferedReader din,
java.lang.String end,
java.lang.String separator)
Reads lines in din until end was found. |
static void |
log(char d,
java.lang.String method,
java.lang.String id,
java.lang.String text)
|
static boolean |
messageMatch(java.lang.String searchmessage,
java.lang.String message)
Searches the string search in the source and gives the following chars until the seperator back as a string |
static boolean |
moveFile(java.lang.String source,
java.lang.String destination)
move a file |
static java.util.Hashtable |
newHashtable()
Creates the static Hashtable |
static java.awt.Color |
parseColor(java.lang.String hexcolor)
parse a hexstring into a Color |
static int |
readJEObj(java.io.BufferedReader din,
java.util.Hashtable oht)
Reads out of din all JEObject. |
static java.lang.String |
regardLocale(java.lang.String message,
java.lang.String locale)
Excludes all locales exclude the given locale out of the message |
static boolean |
registerJECallBack(JECallBack jeCallBack,
java.lang.String jeasyId)
Registers a JECallBack to a JEasyId. |
static java.lang.String |
removeLocales(java.lang.String message)
|
static boolean |
renameFile(java.lang.String source,
java.lang.String destination)
rename a file |
static java.lang.String |
replace(java.lang.String target,
java.lang.String from,
java.lang.String to)
replaces String in String |
static java.lang.String |
replaceTagId(java.lang.String source,
java.lang.String tag,
java.lang.String id,
java.lang.String newString)
replaces the tag tag with the tag id inside with newString and copys all tag after the root tag ... |
static java.lang.String |
replaceXMLGeneralEntities(java.lang.String s,
boolean b)
replaces general XML entities in a String |
static java.util.Vector |
replaceXMLGeneralEntities(java.util.Vector v,
boolean b)
replaces general XML entities in a Vector containing String |
static java.lang.String |
separateLocales(JEObject jeo,
java.lang.String message)
Separates a JEObject xml message in a part without any locale properties and returns this xml message. |
static java.util.Hashtable |
setHashtable(java.util.Hashtable poht)
Sets the static Hashtable |
static boolean |
str2f(java.lang.String source,
java.lang.String destination)
copy a String to a file |
static boolean |
writeFile(java.lang.String s,
java.lang.String destination)
writes a file |
static java.lang.Object |
XMLMethodInvocation(java.lang.Object object,
java.lang.String xmi)
Invokes a method defined in the XML-String xmi of the given Object object |
static java.lang.Object |
XMLMethodInvocation(java.lang.String xmi)
Invokes a method of an JEasyObject out of an XML string. |
static boolean |
XMLVectorMatch(java.util.Vector v_search,
java.util.Vector v_tags)
Matching of two Vectors |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.util.Comparator stringCmp
| Constructor Detail |
|---|
public JEUtil()
| Method Detail |
|---|
public static java.lang.Object XMLMethodInvocation(java.lang.String xmi)
xmi - XML-String
public static java.lang.Object XMLMethodInvocation(java.lang.Object object,
java.lang.String xmi)
obj - object where the method is implementedxmi - XML-String that defines the method and paramspublic static javax.swing.JRootPane getRootPane()
public static javax.swing.JLayeredPane getLayeredPane()
public static java.lang.String getXMLElement(java.lang.String source,
java.lang.String element)
source - the string where it will be searchedelement - the XML element to look for
public static java.lang.String getXMLElementNoReplace(java.lang.String source,
java.lang.String element)
source - the string where it will be searchedelement - the XML element to look for
public static java.lang.String getXMLElementByAttributeValue(java.lang.String source,
java.lang.String element,
java.lang.String attribute,
java.lang.String value)
source - the string where it will be searchedelement - the XML element to look forattribute - the attibute the element must havevalue - and its value
public static java.lang.String getXMLElementAttribute(java.lang.String source,
java.lang.String element,
java.lang.String attribut)
source - the string where it will be searchedelement - the XML element to look for
public static java.lang.String getXMLElementAttribute(java.lang.String source,
java.lang.String attribut)
source - the string where it will be searched
public static java.lang.String[] getXMLElementArray(java.lang.String source,
java.lang.String element)
source - the string where it will be searchedelement - the XML element to look for
public static java.util.Vector getXMLTagVector(java.lang.String source,
java.lang.String tagname)
source - the string where it will be searchedtagname - the XML tagname to look for
public static java.util.Vector getXMLVector(java.lang.String source,
java.lang.String tag,
java.lang.String innerTag)
source - the string where it will be searchedtag - the XML element to look forinnerTag - the XML element given back as a Vector
public static java.util.Vector getXMLElementVectorNoReplace(java.lang.String source,
java.lang.String element)
source - the string where it will be searchedelement - the XML element to look for
public static java.util.Vector getXMLElementVector(java.lang.String source,
java.lang.String element)
source - the string where it will be searchedelement - the XML element to look for
public static boolean XMLVectorMatch(java.util.Vector v_search,
java.util.Vector v_tags)
source - the string where it will be searched
public static boolean messageMatch(java.lang.String searchmessage,
java.lang.String message)
source - the string where it will be searchedsearch - the string to look forseparator - the string to look for
public static java.lang.String getFormattedSum(java.util.Vector v)
public static java.lang.String is2s(java.io.InputStream is)
after each line
public static java.lang.String l2s(java.io.BufferedReader din,
java.lang.String end)
throws java.io.IOException
din - read by readLine()end - terminates reading
java.io.IOException
public static java.lang.String l2s(java.io.BufferedReader din,
java.lang.String end,
java.lang.String separator)
throws java.io.IOException
din - read by readLine()end - terminates reading
java.io.IOException
public static void log(char d,
java.lang.String method,
java.lang.String id,
java.lang.String text)
public static java.util.Hashtable newHashtable()
public static java.util.Hashtable getHashtable()
public static java.util.Hashtable setHashtable(java.util.Hashtable poht)
public static JEObject getJO(java.lang.String s)
name - Meldung
public static JEObject getJO(java.lang.String s,
boolean quiet)
name - Meldungpublic static java.lang.String getDateTime(java.lang.String format)
format -
public static java.lang.String getDateTime()
format -
public static java.lang.String isr2str(java.io.InputStreamReader isr)
public static java.lang.Object invokeAll(JEObject jeo,
java.lang.String function,
java.lang.Object[] oa,
java.lang.Object until)
public static java.awt.Color parseColor(java.lang.String hexcolor)
public static java.lang.Object invoke(JEObject jo,
java.lang.String function,
java.lang.Object[] oa)
public static java.lang.String it(java.lang.String tag,
java.lang.String value)
tag - value -
public static java.lang.String itt(java.lang.String tag,
java.lang.String value)
tag - value -
public static java.lang.String itv(java.lang.String tagroot,
java.lang.String tagelement,
java.util.Vector v)
tagroot - tagelement - v -
public static int readJEObj(java.io.BufferedReader din,
java.util.Hashtable oht)
throws java.io.IOException
java.io.IOException - when reading out of din is not possible
public static java.lang.String replace(java.lang.String target,
java.lang.String from,
java.lang.String to)
s - String which is to be parsedold - String which will be replaced by
public static java.lang.String replaceXMLGeneralEntities(java.lang.String s,
boolean b)
s - xml-String which is to be parsed and whose xml entities are to be replacedb - true special characters are replaced by the entity, false the entities are replaced by the special characters
public static java.util.Vector replaceXMLGeneralEntities(java.util.Vector v,
boolean b)
v - Vector containing string-objects to be parsed and and whose xml entities are to be replacedb - true special characters are replaced by the entity, false the entities are replaced by the special characters
public static boolean existsFile(java.lang.String source)
source - source-file
public static boolean copyFile(java.lang.String source,
java.lang.String destination)
source - source-filedestination - destination-file
public static boolean writeFile(java.lang.String s,
java.lang.String destination)
data - string to writedestination - destination-file
public static boolean str2f(java.lang.String source,
java.lang.String destination)
source - Stringdestination - destination-file
public static boolean deleteFile(java.lang.String source)
source - source-file
public static boolean moveFile(java.lang.String source,
java.lang.String destination)
source - source-filedestination - destination-file
public static boolean renameFile(java.lang.String source,
java.lang.String destination)
source - source-filedestination - destination-file
public static java.lang.String f2str(java.lang.String source)
file - file
public static java.lang.String replaceTagId(java.lang.String source,
java.lang.String tag,
java.lang.String id,
java.lang.String newString)
source - String where to replacetag - tagname to replaceid - the id of the tag idnewString - the String wich replaces the oldpublic void customizeObject(java.lang.String s)
It should be used to change properties of jeasy objects. You define the jeasy object the propertie and the value. The method will perform the setting of the propertie. You may define the customize string as a JEString object in JEasy or read it out of a file. The example explains the syntax:
<custom>
<id>JEasyObjectId</id>
<method>methodname</method>
<param>String</param>
<method>methodname</method>
<param>true|false</param>
</custom>
Example:
<pre><custom>
<id>DF_Name</id>
<method>setText</method>
<param>Miller</param>
<method>setEnabled</method>
<param>false</param>
</custom>
</pre>
public static java.lang.String separateLocales(JEObject jeo,
java.lang.String message)
jeo - message -
public static java.lang.String regardLocale(java.lang.String message,
java.lang.String locale)
message - locale -
public static java.lang.String removeLocales(java.lang.String message)
public byte[] compress(byte[] ba,
javax.crypto.Cipher ec)
throws java.lang.Exception
java.lang.Exception
public byte[] compress(java.lang.String s)
throws java.lang.Exception
java.lang.Exception
public byte[] compress(java.lang.String s,
javax.crypto.Cipher ec)
throws java.lang.Exception
java.lang.Exception
public java.lang.String decompress(java.io.InputStream in)
throws java.lang.Exception
java.lang.Exception
public java.lang.String decompress(java.io.InputStream in,
javax.crypto.Cipher dc)
throws java.lang.Exception
java.lang.Exceptionpublic byte[] compress(byte[] ba)
public byte[] decompress(byte[] ba)
public byte[] decrypt(byte[] ba,
javax.crypto.Cipher decryptCipher)
throws java.lang.Exception
java.lang.Exception
public byte[] encrypt(byte[] ba,
javax.crypto.Cipher encryptCipher)
throws java.lang.Exception
java.lang.Exception
public static boolean registerJECallBack(JECallBack jeCallBack,
java.lang.String jeasyId)
jeCallBack - jeasyId -
public static JECallBack getRegisteredJECallBack(java.lang.String jeasyId)
jeCallBack - jeasyId -
public static java.util.Vector getSeparatedList(java.util.Vector v,
java.lang.String entries,
java.lang.String separator)
v - entries - separator -
public static java.lang.String getMemory()
public static java.lang.String getMemory(java.lang.String label)
label -
public static java.awt.Point adjustLocationToScreen(java.awt.Component cmp,
int xposition,
int yposition)
cmp - Component to showxposition - desired x positionyposition - desired y position
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||