Top Inners Fields Constructors Methods
com.thoughtworks.xstream.core

public Class JVM

extends Object
implements Caching
Class Inheritance
All Implemented Interfaces
com.thoughtworks.xstream.core.Caching
Imports
java.io.IOException, java.lang.reflect.Field, .Method, java.text.AttributedString, .ParseException, .SimpleDateFormat, java.util.Comparator, .SortedMap, .SortedSet, .TreeMap, .TreeSet, com.thoughtworks.xstream.converters.reflection.FieldDictionary, .ObjectAccessException, .PureJavaReflectionProvider, .ReflectionProvider, com.thoughtworks.xstream.core.util.Base64Encoder, .CustomObjectOutputStream, .DependencyInjectionFactory, .PresortedMap, .PresortedSet

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final StringCodec
private static final boolean
private static final boolean
private static final boolean
private static final boolean
private static final boolean
private static final float
private static final boolean
private static final boolean
private static final boolean
private static final float
private static final boolean
private static final boolean
private ReflectionProvider
private static final Class<T>
private static final boolean
private static final String

Constructor Summary

AccessConstructor and Description
public
JVM()

Deprecated As of 1.4.5 use the static methods of JVM.

Method Summary

Modifier and TypeMethod and Description
public synchronized ReflectionProvider
bestReflectionProvider()

Deprecated As of 1.4.5 use newReflectionProvider()
public static boolean
public static boolean
public static boolean
private static boolean
private static boolean
public void
flushCache()

Implements com.thoughtworks.xstream.core.Caching.flushCache.

Deprecated As of 1.4.5 no functionality
public static StringCodec

Returns:

a Base64 codec implementation
getBase64Codec
()

Get an available Base64 implementation.

private static final float

Returns:

A float of the form 1.x
getMajorJavaVersion
()

Parses the java version system property to determine the major java version, i.e. 1.x

public static Class<T>

Returns:

the XMLInputFactory implementation or null
getStaxInputFactory
()

Get the XMLInputFactory implementation used normally by the current Java runtime as standard.

public static Class<T>

Returns:

the XMLOutputFactory implementation or null
getStaxOutputFactory
()

Get the XMLOutputFactory implementation used normally by the current Java runtime as standard.

public static boolean
hasOptimizedTreeMapPutAll()

Checks if TreeMap.putAll is optimized for SortedMap argument.

public static boolean
hasOptimizedTreeSetAddAll()

Checks if TreeSet.addAll is optimized for SortedSet argument.

public static boolean
is14()

Deprecated As of 1.4.4, minimal JDK version is 1.4 already
public static boolean
is15()

Deprecated As of 1.4.4, minimal JDK version will be 1.7 for next major release
public static boolean
is16()

Deprecated As of 1.4.4, minimal JDK version will be 1.7 for next major release
public static boolean
is17()

Deprecated As of 1.4.10, minimal JDK version will be 1.7 for next major release
public static boolean
is18()

Deprecated As of 1.4.11 use isVersion(int).
public static boolean
is19()

Deprecated As of 1.4.10 use isVersion(int).
public static boolean
is9()

Deprecated As of 1.4.11 use isVersion(int)
private static boolean
public static boolean
isAWTAvailable()

Checks if AWT is available.

private static boolean
public static boolean
isSQLAvailable()

Checks if SQL is available.

public static boolean
isSwingAvailable()

Checks if Swing is available.

public static boolean

Returns:

true if current runtime is at least the provided major version
isVersion
(final int
the requested major Java version
version
)

Checks current runtime against provided major Java version.

public Class<T>
loadClass(String name)

Deprecated As of 1.4.5 use loadClassForName(String)
public Class<T>
loadClass(String name, boolean initialize)

Deprecated As of 1.4.5 use loadClassForName(String, boolean)
public static Class<T>
loadClassForName(String name)

Load a XStream class for the given name.

public static Class<T>
loadClassForName(String name, boolean initialize)

Load a XStream class for the given name.

public static void
main(String[] args)

public static ReflectionProvider

Returns:

a new instance
newReflectionProvider
()

Create the best matching ReflectionProvider.

public static ReflectionProvider

Returns:

a new instance
newReflectionProvider
(FieldDictionary
the FieldDictionary to use by the ReflectionProvider
dictionary
)

Create the best matching ReflectionProvider.

public static boolean
reverseFieldDefinition()

Deprecated As of 1.4.5
public boolean
supportsAWT()

Deprecated As of 1.4.5 use isAWTAvailable()
Checks if the JVM supports AWT.
public boolean
supportsSQL()

Deprecated As of 1.4.5 use isSQLAvailable()
Checks if the JVM supports SQL.
public boolean
supportsSwing()

Deprecated As of 1.4.5 use isSwingAvailable()
Checks if the JVM supports Swing.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

base64Codecback to summary
private static final StringCodec base64Codec
canAllocateWithUnsafeback to summary
private static final boolean canAllocateWithUnsafe
canCreateDerivedObjectOutputStreamback to summary
private static final boolean canCreateDerivedObjectOutputStream
canParseISO8601TimeZoneInDateFormatback to summary
private static final boolean canParseISO8601TimeZoneInDateFormat
canParseUTCDateFormatback to summary
private static final boolean canParseUTCDateFormat
canWriteWithUnsafeback to summary
private static final boolean canWriteWithUnsafe
DEFAULT_JAVA_VERSIONback to summary
private static final float DEFAULT_JAVA_VERSION
isAWTAvailableback to summary
private static final boolean isAWTAvailable
isSQLAvailableback to summary
private static final boolean isSQLAvailable
isSwingAvailableback to summary
private static final boolean isSwingAvailable
majorJavaVersionback to summary
private static final float majorJavaVersion
optimizedTreeMapPutAllback to summary
private static final boolean optimizedTreeMapPutAll
optimizedTreeSetAddAllback to summary
private static final boolean optimizedTreeSetAddAll
reflectionProviderback to summary
private ReflectionProvider reflectionProvider
reflectionProviderTypeback to summary
private static final Class<T> reflectionProviderType
reverseFieldOrderback to summary
private static final boolean reverseFieldOrder
vendorback to summary
private static final String vendor

Constructor Detail

JVMback to summary
public JVM()

Deprecated

As of 1.4.5 use the static methods of JVM.

Method Detail

bestReflectionProviderback to summary
public synchronized ReflectionProvider bestReflectionProvider()

Deprecated

As of 1.4.5 use newReflectionProvider()

canCreateDerivedObjectOutputStreamback to summary
public static boolean canCreateDerivedObjectOutputStream()
Since
1.4.6
canParseISO8601TimeZoneInDateFormatback to summary
public static boolean canParseISO8601TimeZoneInDateFormat()
Since
1.4.8
canParseUTCDateFormatback to summary
public static boolean canParseUTCDateFormat()
canUseSunLimitedUnsafeReflectionProviderback to summary
private static boolean canUseSunLimitedUnsafeReflectionProvider()
canUseSunUnsafeReflectionProviderback to summary
private static boolean canUseSunUnsafeReflectionProvider()
flushCacheback to summary
public void flushCache()

Implements com.thoughtworks.xstream.core.Caching.flushCache.

Deprecated

As of 1.4.5 no functionality

getBase64Codecback to summary
public static StringCodec getBase64Codec()

Get an available Base64 implementation. Prefers java.util.Base64 over DataTypeConverter from JAXB over XStream's own implementation.

Returns:StringCodec

a Base64 codec implementation

Since
1.4.11
getMajorJavaVersionback to summary
private static final float getMajorJavaVersion()

Parses the java version system property to determine the major java version, i.e. 1.x

Returns:float

A float of the form 1.x

getStaxInputFactoryback to summary
public static Class<T> getStaxInputFactory() throws ClassNotFoundException

Get the XMLInputFactory implementation used normally by the current Java runtime as standard.

In contrast to XMLInputFactory.newFactory() this method will ignore any implementations provided with the system property javax.xml.stream.XMLInputFactory, implementations configured in lib/stax.properties or registered with the Service API.

Returns:Class<T>

the XMLInputFactory implementation or null

Exceptions
ClassNotFoundException:
if the standard class cannot be found
Since
1.4.5
getStaxOutputFactoryback to summary
public static Class<T> getStaxOutputFactory() throws ClassNotFoundException

Get the XMLOutputFactory implementation used normally by the current Java runtime as standard.

In contrast to XMLOutputFactory.newFactory() this method will ignore any implementations provided with the system property javax.xml.stream.XMLOutputFactory, implementations configured in lib/stax.properties or registered with the Service API.

Returns:Class<T>

the XMLOutputFactory implementation or null

Exceptions
ClassNotFoundException:
if the standard class cannot be found
Since
1.4.5
hasOptimizedTreeMapPutAllback to summary
public static boolean hasOptimizedTreeMapPutAll()

Checks if TreeMap.putAll is optimized for SortedMap argument.

Since
1.4
hasOptimizedTreeSetAddAllback to summary
public static boolean hasOptimizedTreeSetAddAll()

Checks if TreeSet.addAll is optimized for SortedSet argument.

Since
1.4
is14back to summary
public static boolean is14()

Deprecated

As of 1.4.4, minimal JDK version is 1.4 already

is15back to summary
public static boolean is15()

Deprecated

As of 1.4.4, minimal JDK version will be 1.7 for next major release

is16back to summary
public static boolean is16()

Deprecated

As of 1.4.4, minimal JDK version will be 1.7 for next major release

is17back to summary
public static boolean is17()

Deprecated

As of 1.4.10, minimal JDK version will be 1.7 for next major release

Since
1.4
is18back to summary
public static boolean is18()

Deprecated

As of 1.4.11 use isVersion(int).

Since
1.4
is19back to summary
public static boolean is19()

Deprecated

As of 1.4.10 use isVersion(int).

Since
1.4.8
is9back to summary
public static boolean is9()

Deprecated

As of 1.4.11 use isVersion(int)

Since
1.4.10
isAndroidback to summary
private static boolean isAndroid()
Since
1.4
isAWTAvailableback to summary
public static boolean isAWTAvailable()

Checks if AWT is available.

Since
1.4.5
isIBMback to summary
private static boolean isIBM()
isSQLAvailableback to summary
public static boolean isSQLAvailable()

Checks if SQL is available.

Since
1.4.5
isSwingAvailableback to summary
public static boolean isSwingAvailable()

Checks if Swing is available.

Since
1.4.5
isVersionback to summary
public static boolean isVersion(final int version)

Checks current runtime against provided major Java version.

Parameters
version:int

the requested major Java version

Returns:boolean

true if current runtime is at least the provided major version

Since
1.4.11
loadClassback to summary
public Class<T> loadClass(String name)

Deprecated

As of 1.4.5 use loadClassForName(String)

loadClassback to summary
public Class<T> loadClass(String name, boolean initialize)

Deprecated

As of 1.4.5 use loadClassForName(String, boolean)

Since
1.4.4
loadClassForNameback to summary
public static Class<T> loadClassForName(String name)

Load a XStream class for the given name.

This method is not meant to use loading arbitrary classes. It is used by XStream bootstrap until it is able to use the user provided or the default ClassLoader.

Since
1.4.5
loadClassForNameback to summary
public static Class<T> loadClassForName(String name, boolean initialize)

Load a XStream class for the given name.

This method is not meant to use loading arbitrary classes. It is used by XStream bootstrap until it is able to use the user provided or the default ClassLoader.

Since
1.4.5
mainback to summary
public static void main(String[] args)
newReflectionProviderback to summary
public static ReflectionProvider newReflectionProvider()

Create the best matching ReflectionProvider.

Returns:ReflectionProvider

a new instance

Since
1.4.5
newReflectionProviderback to summary
public static ReflectionProvider newReflectionProvider(FieldDictionary dictionary)

Create the best matching ReflectionProvider.

Parameters
dictionary:FieldDictionary

the FieldDictionary to use by the ReflectionProvider

Returns:ReflectionProvider

a new instance

Since
1.4.5
reverseFieldDefinitionback to summary
public static boolean reverseFieldDefinition()

Deprecated

As of 1.4.5

supportsAWTback to summary
public boolean supportsAWT()

Deprecated

As of 1.4.5 use isAWTAvailable()

Checks if the JVM supports AWT.

supportsSQLback to summary
public boolean supportsSQL()

Deprecated

As of 1.4.5 use isSQLAvailable()

Checks if the JVM supports SQL.

supportsSwingback to summary
public boolean supportsSwing()

Deprecated

As of 1.4.5 use isSwingAvailable()

Checks if the JVM supports Swing.

com.thoughtworks.xstream.core back to summary

pack-priv Class JVM.Test

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private byte
b

private boolean
private char
c

private double
d

private float
f

private int
i

private long
l

private Object
o

private short
s

Constructor Summary

AccessConstructor and Description
pack-priv
Test()

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bback to summary
private byte b
boolback to summary
private boolean bool
cback to summary
private char c
dback to summary
private double d
fback to summary
private float f
iback to summary
private int i
lback to summary
private long l
oback to summary
private Object o
sback to summary
private short s

Constructor Detail

Testback to summary
pack-priv Test()