protected void addDefaults() { // null handling addDefaultImplementation(null, Mapper.Null.class); // register primitive types addDefaultImplementation(Boolean.class, boolean.class); addDefaultImplementation(Character.class, char.class); addDefaultImplementation(Integer.class, int.class); addDefaultImplementation(Float.class, float.class); addDefaultImplementation(Double.class, double.class); addDefaultImplementation(Short.class, short.class); addDefaultImplementation(Byte.class, byte.class); addDefaultImplementation(Long.class, long.class); }
/** * Associate a default implementation of a class with an object. Whenever XStream encounters * an instance of this type, it will use the default implementation instead. For example, * java.util.ArrayList is the default implementation of java.util.List. * * @param defaultImplementation * @param ofType * @throws InitializationException if no {@link DefaultImplementationsMapper} is available */ public void addDefaultImplementation(Class defaultImplementation, Class ofType) { if (defaultImplementationsMapper == null) { throw new com.thoughtworks.xstream.InitializationException("No " + DefaultImplementationsMapper.class.getName() + " available"); } defaultImplementationsMapper.addDefaultImplementation(defaultImplementation, ofType); }
private void processAliasAnnotation(final Class<?> type, final Set<Class<?>> types) { final XStreamAlias aliasAnnotation = type.getAnnotation(XStreamAlias.class); if (aliasAnnotation != null) { if (classAliasingMapper == null) { throw new InitializationException("No " + ClassAliasingMapper.class.getName() + " available"); } classAliasingMapper.addClassAlias(aliasAnnotation.value(), type); if (aliasAnnotation.impl() != Void.class) { // Alias for Interface/Class with an impl defaultImplementationsMapper.addDefaultImplementation( aliasAnnotation.impl(), type); if (type.isInterface()) { types.add(aliasAnnotation.impl()); // alias Interface's impl } } } }
protected void addDefaults() { // null handling addDefaultImplementation(null, Mapper.Null.class); // register primitive types addDefaultImplementation(Boolean.class, boolean.class); addDefaultImplementation(Character.class, char.class); addDefaultImplementation(Integer.class, int.class); addDefaultImplementation(Float.class, float.class); addDefaultImplementation(Double.class, double.class); addDefaultImplementation(Short.class, short.class); addDefaultImplementation(Byte.class, byte.class); addDefaultImplementation(Long.class, long.class); }
protected void addDefaults() { // null handling addDefaultImplementation(null, Mapper.Null.class); // register primitive types addDefaultImplementation(Boolean.class, boolean.class); addDefaultImplementation(Character.class, char.class); addDefaultImplementation(Integer.class, int.class); addDefaultImplementation(Float.class, float.class); addDefaultImplementation(Double.class, double.class); addDefaultImplementation(Short.class, short.class); addDefaultImplementation(Byte.class, byte.class); addDefaultImplementation(Long.class, long.class); }
protected void addDefaults() { // null handling addDefaultImplementation(null, Mapper.Null.class); // register primitive types addDefaultImplementation(Boolean.class, boolean.class); addDefaultImplementation(Character.class, char.class); addDefaultImplementation(Integer.class, int.class); addDefaultImplementation(Float.class, float.class); addDefaultImplementation(Double.class, double.class); addDefaultImplementation(Short.class, short.class); addDefaultImplementation(Byte.class, byte.class); addDefaultImplementation(Long.class, long.class); }
protected void addDefaults() { // null handling addDefaultImplementation(null, Mapper.Null.class); // register primitive types addDefaultImplementation(Boolean.class, boolean.class); addDefaultImplementation(Character.class, char.class); addDefaultImplementation(Integer.class, int.class); addDefaultImplementation(Float.class, float.class); addDefaultImplementation(Double.class, double.class); addDefaultImplementation(Short.class, short.class); addDefaultImplementation(Byte.class, byte.class); addDefaultImplementation(Long.class, long.class); }
protected void addDefaults() { // null handling addDefaultImplementation(null, Mapper.Null.class); // register primitive types addDefaultImplementation(Boolean.class, boolean.class); addDefaultImplementation(Character.class, char.class); addDefaultImplementation(Integer.class, int.class); addDefaultImplementation(Float.class, float.class); addDefaultImplementation(Double.class, double.class); addDefaultImplementation(Short.class, short.class); addDefaultImplementation(Byte.class, byte.class); addDefaultImplementation(Long.class, long.class); }
protected void addDefaults() { // null handling addDefaultImplementation(null, Mapper.Null.class); // register primitive types addDefaultImplementation(Boolean.class, boolean.class); addDefaultImplementation(Character.class, char.class); addDefaultImplementation(Integer.class, int.class); addDefaultImplementation(Float.class, float.class); addDefaultImplementation(Double.class, double.class); addDefaultImplementation(Short.class, short.class); addDefaultImplementation(Byte.class, byte.class); addDefaultImplementation(Long.class, long.class); }
protected void addDefaults() { // null handling addDefaultImplementation(null, Mapper.Null.class); // register primitive types addDefaultImplementation(Boolean.class, boolean.class); addDefaultImplementation(Character.class, char.class); addDefaultImplementation(Integer.class, int.class); addDefaultImplementation(Float.class, float.class); addDefaultImplementation(Double.class, double.class); addDefaultImplementation(Short.class, short.class); addDefaultImplementation(Byte.class, byte.class); addDefaultImplementation(Long.class, long.class); }
protected void addDefaults() { // null handling addDefaultImplementation(null, Mapper.Null.class); // register primitive types addDefaultImplementation(Boolean.class, boolean.class); addDefaultImplementation(Character.class, char.class); addDefaultImplementation(Integer.class, int.class); addDefaultImplementation(Float.class, float.class); addDefaultImplementation(Double.class, double.class); addDefaultImplementation(Short.class, short.class); addDefaultImplementation(Byte.class, byte.class); addDefaultImplementation(Long.class, long.class); }
/** * Associate a default implementation of a class with an object. Whenever XStream encounters an instance of this * type, it will use the default implementation instead. For example, java.util.ArrayList is the default * implementation of java.util.List. * * @param defaultImplementation * @param ofType * @throws InitializationException if no {@link DefaultImplementationsMapper} is available */ public void addDefaultImplementation(final Class<?> defaultImplementation, final Class<?> ofType) { if (defaultImplementationsMapper == null) { throw new InitializationException("No " + DefaultImplementationsMapper.class.getName() + " available"); } defaultImplementationsMapper.addDefaultImplementation(defaultImplementation, ofType); }
/** * Associate a default implementation of a class with an object. Whenever XStream encounters * an instance of this type, it will use the default implementation instead. For example, * java.util.ArrayList is the default implementation of java.util.List. * * @param defaultImplementation * @param ofType * @throws InitializationException if no {@link DefaultImplementationsMapper} is available */ public void addDefaultImplementation(Class defaultImplementation, Class ofType) { if (defaultImplementationsMapper == null) { throw new com.thoughtworks.xstream.InitializationException("No " + DefaultImplementationsMapper.class.getName() + " available"); } defaultImplementationsMapper.addDefaultImplementation(defaultImplementation, ofType); }
/** * Associate a default implementation of a class with an object. Whenever XStream encounters * an instance of this type, it will use the default implementation instead. For example, * java.util.ArrayList is the default implementation of java.util.List. * * @param defaultImplementation * @param ofType * @throws InitializationException if no {@link DefaultImplementationsMapper} is available */ public void addDefaultImplementation(Class defaultImplementation, Class ofType) { if (defaultImplementationsMapper == null) { throw new com.thoughtworks.xstream.InitializationException("No " + DefaultImplementationsMapper.class.getName() + " available"); } defaultImplementationsMapper.addDefaultImplementation(defaultImplementation, ofType); }
/** * Associate a default implementation of a class with an object. Whenever XStream encounters an * instance of this type, it will use the default implementation instead. For example, * java.util.ArrayList is the default implementation of java.util.List. * * @param defaultImplementation * @param ofType * @throws InitializationException if no {@link DefaultImplementationsMapper} is available */ public void addDefaultImplementation(Class defaultImplementation, Class ofType) { if (defaultImplementationsMapper == null) { throw new InitializationException("No " + DefaultImplementationsMapper.class.getName() + " available"); } defaultImplementationsMapper.addDefaultImplementation(defaultImplementation, ofType); }
/** * Associate a default implementation of a class with an object. Whenever XStream encounters * an instance of this type, it will use the default implementation instead. For example, * java.util.ArrayList is the default implementation of java.util.List. * * @param defaultImplementation * @param ofType * @throws InitializationException if no {@link DefaultImplementationsMapper} is available */ public void addDefaultImplementation(Class defaultImplementation, Class ofType) { if (defaultImplementationsMapper == null) { throw new com.thoughtworks.xstream.InitializationException("No " + DefaultImplementationsMapper.class.getName() + " available"); } defaultImplementationsMapper.addDefaultImplementation(defaultImplementation, ofType); }
/** * Associate a default implementation of a class with an object. Whenever XStream encounters * an instance of this type, it will use the default implementation instead. For example, * java.util.ArrayList is the default implementation of java.util.List. * * @param defaultImplementation * @param ofType * @throws InitializationException if no {@link DefaultImplementationsMapper} is available */ public void addDefaultImplementation(Class defaultImplementation, Class ofType) { if (defaultImplementationsMapper == null) { throw new com.thoughtworks.xstream.InitializationException("No " + DefaultImplementationsMapper.class.getName() + " available"); } defaultImplementationsMapper.addDefaultImplementation(defaultImplementation, ofType); }
@Override public void addDefaultImplementation(final Class defaultImplementation, final Class ofType) { super.addDefaultImplementation(defaultImplementation, ofType); if (typeWhitelist != null) { if (defaultImplementation != null) { typeWhitelist.allowType(defaultImplementation); } if (ofType != null) { typeWhitelist.allowType(ofType); } } } };
private void processAliasAnnotation(final Class<?> type, final Set<Class<?>> types) { final XStreamAlias aliasAnnotation = type.getAnnotation(XStreamAlias.class); if (aliasAnnotation != null) { if (classAliasingMapper == null) { throw new InitializationException("No " + ClassAliasingMapper.class.getName() + " available"); } classAliasingMapper.addClassAlias(aliasAnnotation.value(), type); if (aliasAnnotation.impl() != Void.class) { // Alias for Interface/Class with an impl defaultImplementationsMapper.addDefaultImplementation(aliasAnnotation.impl(), type); if (type.isInterface()) { types.add(aliasAnnotation.impl()); // alias Interface's impl } } } }
private void processAliasAnnotation(final Class<?> type, final Set<Class<?>> types) { final XStreamAlias aliasAnnotation = type.getAnnotation(XStreamAlias.class); if (aliasAnnotation != null) { if (classAliasingMapper == null) { throw new InitializationException("No " + ClassAliasingMapper.class.getName() + " available"); } classAliasingMapper.addClassAlias(aliasAnnotation.value(), type); if (aliasAnnotation.impl() != Void.class) { // Alias for Interface/Class with an impl defaultImplementationsMapper.addDefaultImplementation( aliasAnnotation.impl(), type); if (type.isInterface()) { types.add(aliasAnnotation.impl()); // alias Interface's impl } } } }