org.apache.axis.utils
public class JavaUtils extends Object
Nested Class Summary | |
---|---|
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 |
protected static Log | log |
static String | LS
The prefered line separator |
static char | NL |
Method Summary | |
---|---|
static Object | convert(Object arg, Class destClass) Utility function to convert an Object to some desired Class.
|
static Object | getHolderValue(Object holder)
Gets the Holder value. |
static Class | getHolderValueType(Class type)
Determines if the Class is a Holder class. |
static Image | getImageFromStream(InputStream is) |
static String | getLoadableClassName(String text)
Converts text of the form
Foo[] to the proper class name for loading [LFoo |
static Class | getPrimitiveClass(Class wrapper) |
static String | getTextClassName(String text)
Converts text of the form
[LFoo to the Foo[] |
static String | getUniqueValue(Collection values, String initValue)
Makes the value passed in initValue unique among the
{@link String} values contained in values by suffixing
it with a decimal digit suffix. |
static String | getWrapper(String primitive) |
static Class | getWrapperClass(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(Class javaType) |
static boolean | isConvertable(Object obj, Class dest) |
static boolean | isConvertable(Object obj, Class dest, boolean isEncoded) |
static boolean | isEnumClass(Class cls)
Determine if the class is a JAX-RPC enum class.
|
static boolean | isFalse(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 | isFalse(Object value, boolean defaultVal)
Tests the Object 'value':
if its null, return default.
if its a Boolean, return booleanValue()
if its an Integer, return 'false' if its '0' else 'true'
if its a String, return 'false' if its 'false', 'no', or '0' - else 'true'
All other types return 'true' |
static boolean | isFalse(Object value) |
static boolean | isFalseExplicitly(String value)
Tests the String 'value':
return 'true' if its null, 'false', '0', or 'no' - else 'false' |
static boolean | isFalseExplicitly(Object value, boolean defaultVal)
Tests the Object 'value':
if its null, return default.
if its a Boolean, return ! |
static boolean | isFalseExplicitly(Object value) |
static boolean | isJavaId(String id)
isJavaId
Returns true if the name is a valid java identifier. |
static boolean | isJavaKeyword(String keyword)
checks if the input string is a valid java keyword. |
static boolean | isTrue(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 | isTrue(Object value, boolean defaultVal)
Tests the Object 'value':
if its null, return default.
if its a Boolean, return booleanValue()
if its an Integer, return 'false' if its '0' else 'true'
if its a String, return 'false' if its 'false', 'no', or '0' - else 'true'
All other types return 'true' |
static boolean | isTrue(Object value) |
static boolean | isTrueExplicitly(String value)
Tests the String 'value':
return 'true' if its 'true', '1', or 'yes' - else 'false' |
static boolean | isTrueExplicitly(Object value, boolean defaultVal)
Tests the Object 'value':
if its null, return default.
if its a Boolean, return booleanValue()
if its an Integer, return 'false' if its '0' else 'true'
if its a String, return isTrueExplicitly((String)value).
|
static boolean | isTrueExplicitly(Object value) |
static String | makeNonJavaKeyword(String keyword)
Turn a java keyword string into a non-Java keyword string. |
static String | mimeToJava(String mime)
Given the MIME type string, return the Java mapping. |
static String | replace(String name, String oldT, String newT)
replace:
Like String.replace except that the old new items are strings.
|
static void | setHolderValue(Object holder, Object value)
Sets the Holder value. |
static String | stackToString(Throwable e) |
static String | xmlNameToJava(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"
|
Parameters: arg the array to convert destClass the actual class we want
Parameters: holder Holder object
Returns: value object
Parameters: type the suspected Holder Class
Returns: class of held type or null
initValue
unique among the
{@link String} values contained in values
by suffixing
it with a decimal digit suffix.Parameters: id to check
Returns: boolean true/false
Returns: boolean true/false
Parameters: name string oldT old text to replace newT new text to use
Returns: replacement string
Parameters: holder Holder object value is the object value
Parameters: name is the xml name
Returns: the java name per JSR 101 specification