Package ch.tocco.nice2.util.xstream
Class XStreamBuilder
java.lang.Object
ch.tocco.nice2.util.xstream.XStreamBuilder
use this builder to get an instance of
XStream
the available methods are designed to be used with a annotation-based configuration of XStream, but you can configure
the built instance further if you'd like
this builder makes sure that the security framework is initialized so no warnings get logged. If nothing is
configured by the caller, XStream.setupDefaultSecurity(XStream)
will be used
the built instance always ignores unknown elements-
Method Summary
Modifier and TypeMethodDescriptioncom.thoughtworks.xstream.XStream
build()
static XStreamBuilder
create()
withAllowedType
(Class<?> clazz) withAllowedTypes
(String pattern) allow access to exacts types or packages matching a given patternwithAnnotatedClass
(Class classToProcess) proccess annotations of the given class and allow access to itwithClassLoader
(@Nullable ClassLoader classLoader) withConverter
(com.thoughtworks.xstream.converters.Converter converter) withConverter
(com.thoughtworks.xstream.converters.SingleValueConverter converter) withDriver
(com.thoughtworks.xstream.io.HierarchicalStreamDriver driver) withMapper
(@Nullable com.thoughtworks.xstream.mapper.Mapper mapper) do not use our default security, i.e.
-
Method Details
-
create
-
withDriver
-
withMapper
-
withClassLoader
-
withConverter
-
withConverter
public XStreamBuilder withConverter(com.thoughtworks.xstream.converters.SingleValueConverter converter) -
withoutDefaultSecurity
do not use our default security, i.e.XStream.setupDefaultSecurity(XStream)
and access to org.joda.time classes- Returns:
- the builder
-
withAnnotatedClass
proccess annotations of the given class and allow access to it- Parameters:
classToProcess
- the class to use- Returns:
- the builder
-
withAllowedTypes
allow access to exacts types or packages matching a given pattern- Parameters:
pattern
- the pattern, seeXStream.allowTypesByWildcard(String[])
for expected pattern format- Returns:
- the builder
-
withAllowedType
-
build
public com.thoughtworks.xstream.XStream build()
-