|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.axis.utils.JavaUtils
Utility class to deal with Java language related issues, such as type conversions.
Nested Class Summary | |
static interface |
JavaUtils.ConvertCache
It the argument to the convert(...) method implements the ConvertCache interface, the convert(...) method will use the set/get methods to store and retrieve converted values. |
static class |
JavaUtils.HolderException
|
Field Summary | |
static char |
CR
|
static java.lang.String |
LS
The prefered line separator |
static char |
NL
|
Method Summary | |
static java.lang.Object |
convert(java.lang.Object arg,
java.lang.Class destClass)
Utility function to convert an Object to some desired Class. |
static java.lang.Object |
getHolderValue(java.lang.Object holder)
Gets the Holder value. |
static java.lang.Class |
getHolderValueType(java.lang.Class type)
Determines if the Class is a Holder class. |
static java.awt.Image |
getImageFromStream(java.io.InputStream is)
|
static java.lang.String |
getLoadableClassName(java.lang.String text)
Converts text of the form Foo[] to the proper class name for loading [LFoo |
static java.lang.Class |
getPrimitiveClass(java.lang.Class wrapper)
|
static java.lang.String |
getTextClassName(java.lang.String text)
Converts text of the form [LFoo to the Foo[] |
static java.lang.String |
getUniqueValue(java.util.Collection values,
java.lang.String initValue)
Makes the value passed in initValue unique among the
String values contained in values by suffixing
it with a decimal digit suffix. |
static java.lang.String |
getWrapper(java.lang.String primitive)
|
static java.lang.Class |
getWrapperClass(java.lang.Class primitive)
|
static boolean |
isAttachmentSupported()
Determine whether attachments are supported by checking if the following classes are available: javax.activation.DataHandler, javax.mail.internet.MimeMultipart. |
static boolean |
isBasic(java.lang.Class javaType)
|
static boolean |
isConvertable(java.lang.Object obj,
java.lang.Class dest)
|
static boolean |
isConvertable(java.lang.Object obj,
java.lang.Class dest,
boolean isEncoded)
|
static boolean |
isEnumClass(java.lang.Class cls)
Determine if the class is a JAX-RPC enum class. |
static boolean |
isFalse(java.lang.Object value)
|
static boolean |
isFalse(java.lang.Object value,
boolean defaultVal)
Tests the Object 'value': if its null, return default. |
static boolean |
isFalse(java.lang.String value)
Tests the String 'value': return 'true' if its 'false', '0', or 'no' - else 'false' Follow in 'C' tradition of boolean values: false is specific (0), everything else is true; |
static boolean |
isFalseExplicitly(java.lang.Object value)
|
static boolean |
isFalseExplicitly(java.lang.Object value,
boolean defaultVal)
Tests the Object 'value': if its null, return default. |
static boolean |
isFalseExplicitly(java.lang.String value)
Tests the String 'value': return 'true' if its null, 'false', '0', or 'no' - else 'false' |
static boolean |
isHolder(java.lang.Class clazz)
|
static boolean |
isJavaId(java.lang.String id)
isJavaId Returns true if the name is a valid java identifier. |
static boolean |
isJavaKeyword(java.lang.String keyword)
checks if the input string is a valid java keyword. |
static boolean |
isTrue(java.lang.Object value)
|
static boolean |
isTrue(java.lang.Object value,
boolean defaultVal)
Tests the Object 'value': if its null, return default. |
static boolean |
isTrue(java.lang.String value)
Tests the String 'value': return 'false' if its 'false', '0', or 'no' - else 'true' Follow in 'C' tradition of boolean values: false is specific (0), everything else is true; |
static boolean |
isTrueExplicitly(java.lang.Object value)
|
static boolean |
isTrueExplicitly(java.lang.Object value,
boolean defaultVal)
Tests the Object 'value': if its null, return default. |
static boolean |
isTrueExplicitly(java.lang.String value)
Tests the String 'value': return 'true' if its 'true', '1', or 'yes' - else 'false' |
static java.lang.String |
makeNonJavaKeyword(java.lang.String keyword)
Turn a java keyword string into a non-Java keyword string. |
static java.lang.String |
mimeToJava(java.lang.String mime)
Given the MIME type string, return the Java mapping. |
static java.lang.String |
replace(java.lang.String name,
java.lang.String oldT,
java.lang.String newT)
replace: Like String.replace except that the old new items are strings. |
static void |
setHolderValue(java.lang.Object holder,
java.lang.Object value)
Sets the Holder value. |
static java.lang.String |
stackToString(java.lang.Throwable e)
|
static java.lang.String |
xmlNameToJava(java.lang.String name)
Map an XML name to a Java identifier per the mapping rules of JSR 101 (in version 1.0 this is "Chapter 20: Appendix: Mapping of XML Names" |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final char NL
public static final char CR
public static final java.lang.String LS
Method Detail |
public static final boolean isHolder(java.lang.Class clazz)
public static java.lang.Class getWrapperClass(java.lang.Class primitive)
public static java.lang.String getWrapper(java.lang.String primitive)
public static java.lang.Class getPrimitiveClass(java.lang.Class wrapper)
public static boolean isBasic(java.lang.Class javaType)
public static java.lang.Object convert(java.lang.Object arg, java.lang.Class destClass)
arg
- the array to convertdestClass
- the actual class we wantpublic static boolean isConvertable(java.lang.Object obj, java.lang.Class dest)
public static boolean isConvertable(java.lang.Object obj, java.lang.Class dest, boolean isEncoded)
public static java.awt.Image getImageFromStream(java.io.InputStream is)
public static boolean isJavaId(java.lang.String id)
id
- to check
public static boolean isJavaKeyword(java.lang.String keyword)
public static java.lang.String makeNonJavaKeyword(java.lang.String keyword)
public static java.lang.String getLoadableClassName(java.lang.String text)
public static java.lang.String getTextClassName(java.lang.String text)
public static java.lang.String xmlNameToJava(java.lang.String name)
name
- is the xml name
public static final java.lang.String replace(java.lang.String name, java.lang.String oldT, java.lang.String newT)
name
- stringoldT
- old text to replacenewT
- new text to use
public static java.lang.Class getHolderValueType(java.lang.Class type)
type
- the suspected Holder Class
public static java.lang.Object getHolderValue(java.lang.Object holder) throws JavaUtils.HolderException
holder
- Holder object
JavaUtils.HolderException
public static void setHolderValue(java.lang.Object holder, java.lang.Object value) throws JavaUtils.HolderException
holder
- Holder objectvalue
- is the object value
JavaUtils.HolderException
public static boolean isEnumClass(java.lang.Class cls)
public static java.lang.String stackToString(java.lang.Throwable e)
public static final boolean isTrue(java.lang.String value)
public static final boolean isTrueExplicitly(java.lang.String value)
public static final boolean isTrueExplicitly(java.lang.Object value, boolean defaultVal)
public static final boolean isTrueExplicitly(java.lang.Object value)
public static final boolean isTrue(java.lang.Object value, boolean defaultVal)
public static final boolean isTrue(java.lang.Object value)
public static final boolean isFalse(java.lang.String value)
public static final boolean isFalseExplicitly(java.lang.String value)
public static final boolean isFalseExplicitly(java.lang.Object value, boolean defaultVal)
public static final boolean isFalseExplicitly(java.lang.Object value)
public static final boolean isFalse(java.lang.Object value, boolean defaultVal)
public static final boolean isFalse(java.lang.Object value)
public static java.lang.String mimeToJava(java.lang.String mime)
public static boolean isAttachmentSupported()
public static java.lang.String getUniqueValue(java.util.Collection values, java.lang.String initValue)
initValue
unique among the
String
values contained in values
by suffixing
it with a decimal digit suffix.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |