org.apache.axis.utils
public class JavaUtils extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
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 |
Modifier and Type | Field and Description |
---|---|
static char |
CR |
protected static org.apache.commons.logging.Log |
log |
static java.lang.String |
LS
The prefered line separator
|
static char |
NL |
Modifier and Type | Method and Description |
---|---|
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.Class |
getPrimitiveClassFromName(java.lang.String primitive) |
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 |
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"
|
protected static org.apache.commons.logging.Log log
public static final char NL
public static final char CR
public static final java.lang.String LS
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 java.lang.Class getPrimitiveClassFromName(java.lang.String primitive)
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 checkpublic 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 namepublic 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 usepublic static java.lang.Class getHolderValueType(java.lang.Class type)
type
- the suspected Holder Classpublic static java.lang.Object getHolderValue(java.lang.Object holder) throws JavaUtils.HolderException
holder
- Holder objectJavaUtils.HolderException
public static void setHolderValue(java.lang.Object holder, java.lang.Object value) throws JavaUtils.HolderException
holder
- Holder objectvalue
- is the object valueJavaUtils.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.Copyright ? 2005 Apache Web Services Project. All Rights Reserved.