mapper = new ImplicitCollectionMapper(mapper, reflectionProvider); mapper = new OuterClassMapper(mapper); mapper = new ArrayMapper(mapper); mapper = new DefaultImplementationsMapper(mapper); mapper = new AttributeMapper(mapper, converterLookup, reflectionProvider);
public Class realClass(String elementName) { int dimensions = 0; // strip off "-array" suffix while (elementName.endsWith("-array")) { elementName = elementName.substring(0, elementName.length() - 6); // cut off -array ++dimensions; } if (dimensions > 0) { Class componentType = Primitives.primitiveType(elementName); if (componentType == null) { componentType = super.realClass(elementName); } while (componentType.isArray()) { componentType = componentType.getComponentType(); ++dimensions; } return super.realClass(arrayType(dimensions, componentType)); } else { return super.realClass(elementName); } }
public String serializedClass(Class type) { StringBuffer arraySuffix = new StringBuffer(); String name = null; while (type.isArray()) { name = super.serializedClass(type); if (type.getName().equals(name)) { type = type.getComponentType(); arraySuffix.append("-array"); name = null; } else { break; } } if (name == null) { name = boxedTypeName(type); } if (name == null) { name = super.serializedClass(type); } if (arraySuffix.length() > 0) { return name + arraySuffix; } else { return name; } }
public Class realClass(String elementName) { int dimensions = 0; // strip off "-array" suffix while (elementName.endsWith("-array")) { elementName = elementName.substring(0, elementName.length() - 6); // cut off -array ++dimensions; } if (dimensions > 0) { Class componentType = primitiveClassNamed(elementName); if (componentType == null) { componentType = super.realClass(elementName); } while (componentType.isArray()) { componentType = componentType.getComponentType(); ++dimensions; } return super.realClass(arrayType(dimensions, componentType)); } else { return super.realClass(elementName); } }
private String arrayType(int dimensions, Class componentType) { StringBuffer className = new StringBuffer(); for (int i = 0; i < dimensions; i++) { className.append('['); } if (componentType.isPrimitive()) { className.append(charThatJavaUsesToRepresentPrimitiveArrayType(componentType)); return className.toString(); } else { className.append('L').append(componentType.getName()).append(';'); return className.toString(); } }
public Class realClass(String elementName) { int dimensions = 0; // strip off "-array" suffix while (elementName.endsWith("-array")) { elementName = elementName.substring(0, elementName.length() - 6); // cut off -array ++dimensions; } if (dimensions > 0) { Class componentType = primitiveClassNamed(elementName); if (componentType == null) { componentType = super.realClass(elementName); } while (componentType.isArray()) { componentType = componentType.getComponentType(); ++dimensions; } return super.realClass(arrayType(dimensions, componentType)); } else { return super.realClass(elementName); } }
private String arrayType(int dimensions, Class componentType) { StringBuffer className = new StringBuffer(); for (int i = 0; i < dimensions; i++) { className.append('['); } if (componentType.isPrimitive()) { className.append(charThatJavaUsesToRepresentPrimitiveArrayType(componentType)); return className.toString(); } else { className.append('L').append(componentType.getName()).append(';'); return className.toString(); } }
private Mapper buildMapper(ClassLoader cl) { // method exists to replace the default Mapper with the ClassLoaderMapper Mapper mapper = new ClassLoaderMapper(registry, cl); // note do not use XStream11XmlFriendlyMapper mapper = new ClassAliasingMapper(mapper); mapper = new FieldAliasingMapper(mapper); mapper = new AttributeAliasingMapper(mapper); mapper = new AttributeMapper(mapper); mapper = new ImplicitCollectionMapper(mapper); mapper = new DynamicProxyMapper(mapper); if (JVM.is15()) { mapper = new EnumMapper(mapper); } mapper = new OuterClassMapper(mapper); mapper = new ArrayMapper(mapper); mapper = new DefaultImplementationsMapper(mapper); mapper = new ImmutableTypesMapper(mapper); mapper = new CachingMapper(mapper); return mapper; }
@Override public String serializedClass(Class<?> type) { final StringBuilder arraySuffix = new StringBuilder(); String name = null; while (type.isArray()) { name = super.serializedClass(type); if (type.getName().equals(name)) { type = type.getComponentType(); arraySuffix.append("-array"); name = null; } else { break; } } if (name == null) { name = boxedTypeName(type); } if (name == null) { name = super.serializedClass(type); } if (arraySuffix.length() > 0) { return name + arraySuffix; } else { return name; } }
public Class realClass(String elementName) { int dimensions = 0; // strip off "-array" suffix while (elementName.endsWith("-array")) { elementName = elementName.substring(0, elementName.length() - 6); // cut off -array ++dimensions; } if (dimensions > 0) { Class componentType = Primitives.primitiveType(elementName); if (componentType == null) { componentType = super.realClass(elementName); } while (componentType.isArray()) { componentType = componentType.getComponentType(); ++dimensions; } return super.realClass(arrayType(dimensions, componentType)); } else { return super.realClass(elementName); } }
mapper = new ArrayMapper(mapper);
public String serializedClass(Class type) { StringBuffer arraySuffix = new StringBuffer(); String name = null; while (type.isArray()) { name = super.serializedClass(type); if (type.getName().equals(name)) { type = type.getComponentType(); arraySuffix.append("-array"); name = null; } else { break; } } if (name == null) { name = boxedTypeName(type); } if (name == null) { name = super.serializedClass(type); } if (arraySuffix.length() > 0) { return name + arraySuffix; } else { return name; } }
public Class realClass(String elementName) { int dimensions = 0; // strip off "-array" suffix while (elementName.endsWith("-array")) { elementName = elementName.substring(0, elementName.length() - 6); // cut off -array ++dimensions; } if (dimensions > 0) { Class componentType = Primitives.primitiveType(elementName); if (componentType == null) { componentType = super.realClass(elementName); } while (componentType.isArray()) { componentType = componentType.getComponentType(); ++dimensions; } return super.realClass(arrayType(dimensions, componentType)); } else { return super.realClass(elementName); } }
mapper = new ImplicitCollectionMapper(mapper); mapper = new OuterClassMapper(mapper); mapper = new ArrayMapper(mapper); mapper = new DefaultImplementationsMapper(mapper); mapper = new AttributeMapper(mapper, converterLookup);
public String serializedClass(Class type) { StringBuffer arraySuffix = new StringBuffer(); String name = null; while (type.isArray()) { name = super.serializedClass(type); if (type.getName().equals(name)) { type = type.getComponentType(); arraySuffix.append("-array"); name = null; } else { break; } } if (name == null) { name = boxedTypeName(type); } if (name == null) { name = super.serializedClass(type); } if (arraySuffix.length() > 0) { return name + arraySuffix; } else { return name; } }
@Override public Class<?> realClass(String elementName) { int dimensions = 0; // strip off "-array" suffix while (elementName.endsWith("-array")) { elementName = elementName.substring(0, elementName.length() - 6); // cut off -array ++dimensions; } if (dimensions > 0) { Class<?> componentType = Primitives.primitiveType(elementName); if (componentType == null) { componentType = super.realClass(elementName); } while (componentType.isArray()) { componentType = componentType.getComponentType(); ++dimensions; } return super.realClass(arrayType(dimensions, componentType)); } else { return super.realClass(elementName); } }
mapper = new ImplicitCollectionMapper(mapper); mapper = new OuterClassMapper(mapper); mapper = new ArrayMapper(mapper); mapper = new DefaultImplementationsMapper(mapper); mapper = new AttributeMapper(mapper, converterLookup, reflectionProvider);
public String serializedClass(Class type) { StringBuffer arraySuffix = new StringBuffer(); String name = null; while (type.isArray()) { name = super.serializedClass(type); if (type.getName().equals(name)) { type = type.getComponentType(); arraySuffix.append("-array"); name = null; } else { break; } } if (name == null) { name = boxedTypeName(type); } if (name == null) { name = super.serializedClass(type); } if (arraySuffix.length() > 0) { return name + arraySuffix; } else { return name; } }
public Class realClass(String elementName) { int dimensions = 0; // strip off "-array" suffix while (elementName.endsWith("-array")) { elementName = elementName.substring(0, elementName.length() - 6); // cut off -array ++dimensions; } if (dimensions > 0) { Class componentType = Primitives.primitiveType(elementName); if (componentType == null) { componentType = super.realClass(elementName); } while (componentType.isArray()) { componentType = componentType.getComponentType(); ++dimensions; } return super.realClass(arrayType(dimensions, componentType)); } else { return super.realClass(elementName); } }
mapper = new ImplicitCollectionMapper(mapper); mapper = new OuterClassMapper(mapper); mapper = new ArrayMapper(mapper); mapper = new DefaultImplementationsMapper(mapper); mapper = new AttributeMapper(mapper, converterLookup);