public SafeRepresenter() { this.nullRepresenter = new RepresentNull(); this.representers.put(String.class, new RepresentString()); this.representers.put(Boolean.class, new RepresentBoolean()); this.representers.put(Character.class, new RepresentString()); this.representers.put(UUID.class, new RepresentUuid()); this.representers.put(byte[].class, new RepresentByteArray()); Represent primitiveArray = new RepresentPrimitiveArray(); representers.put(short[].class, primitiveArray); representers.put(int[].class, primitiveArray); representers.put(long[].class, primitiveArray); representers.put(float[].class, primitiveArray); representers.put(double[].class, primitiveArray); representers.put(char[].class, primitiveArray); representers.put(boolean[].class, primitiveArray); this.multiRepresenters.put(Number.class, new RepresentNumber()); this.multiRepresenters.put(List.class, new RepresentList()); this.multiRepresenters.put(Map.class, new RepresentMap()); this.multiRepresenters.put(Set.class, new RepresentSet()); this.multiRepresenters.put(Iterator.class, new RepresentIterator()); this.multiRepresenters.put(new Object[0].getClass(), new RepresentArray()); this.multiRepresenters.put(Date.class, new RepresentDate()); this.multiRepresenters.put(Enum.class, new RepresentEnum()); this.multiRepresenters.put(Calendar.class, new RepresentDate()); classTags = new HashMap<Class<? extends Object>, Tag>(); }
public Node representData(Object data) { Class<?> type = data.getClass().getComponentType(); if (byte.class == type) { return representSequence(Tag.SEQ, asByteList(data), DumperOptions.FlowStyle.AUTO); } else if (short.class == type) { return representSequence(Tag.SEQ, asShortList(data), DumperOptions.FlowStyle.AUTO); } else if (int.class == type) { return representSequence(Tag.SEQ, asIntList(data), DumperOptions.FlowStyle.AUTO); } else if (long.class == type) { return representSequence(Tag.SEQ, asLongList(data), DumperOptions.FlowStyle.AUTO); } else if (float.class == type) { return representSequence(Tag.SEQ, asFloatList(data), DumperOptions.FlowStyle.AUTO); } else if (double.class == type) { return representSequence(Tag.SEQ, asDoubleList(data), DumperOptions.FlowStyle.AUTO); } else if (char.class == type) { return representSequence(Tag.SEQ, asCharList(data), DumperOptions.FlowStyle.AUTO); } else if (boolean.class == type) { return representSequence(Tag.SEQ, asBooleanList(data), DumperOptions.FlowStyle.AUTO); } throw new YAMLException("Unexpected primitive '" + type.getCanonicalName() + "'"); }
public SafeRepresenter() { this.nullRepresenter = new RepresentNull(); this.representers.put(String.class, new RepresentString()); this.representers.put(Boolean.class, new RepresentBoolean()); this.representers.put(Character.class, new RepresentString()); this.representers.put(UUID.class, new RepresentUuid()); this.representers.put(byte[].class, new RepresentByteArray()); Represent primitiveArray = new RepresentPrimitiveArray(); representers.put(short[].class, primitiveArray); representers.put(int[].class, primitiveArray); representers.put(long[].class, primitiveArray); representers.put(float[].class, primitiveArray); representers.put(double[].class, primitiveArray); representers.put(char[].class, primitiveArray); representers.put(boolean[].class, primitiveArray); this.multiRepresenters.put(Number.class, new RepresentNumber()); this.multiRepresenters.put(List.class, new RepresentList()); this.multiRepresenters.put(Map.class, new RepresentMap()); this.multiRepresenters.put(Set.class, new RepresentSet()); this.multiRepresenters.put(Iterator.class, new RepresentIterator()); this.multiRepresenters.put(new Object[0].getClass(), new RepresentArray()); this.multiRepresenters.put(Date.class, new RepresentDate()); this.multiRepresenters.put(Enum.class, new RepresentEnum()); this.multiRepresenters.put(Calendar.class, new RepresentDate()); classTags = new HashMap<Class<? extends Object>, Tag>(); }
public SafeRepresenter() { this.nullRepresenter = new RepresentNull(); this.representers.put(String.class, new RepresentString()); this.representers.put(Boolean.class, new RepresentBoolean()); this.representers.put(Character.class, new RepresentString()); this.representers.put(byte[].class, new RepresentByteArray()); Represent primitiveArray = new RepresentPrimitiveArray(); representers.put(short[].class, primitiveArray); representers.put(int[].class, primitiveArray); representers.put(long[].class, primitiveArray); representers.put(float[].class, primitiveArray); representers.put(double[].class, primitiveArray); representers.put(char[].class, primitiveArray); representers.put(boolean[].class, primitiveArray); this.multiRepresenters.put(Number.class, new RepresentNumber()); this.multiRepresenters.put(List.class, new RepresentList()); this.multiRepresenters.put(Map.class, new RepresentMap()); this.multiRepresenters.put(Set.class, new RepresentSet()); this.multiRepresenters.put(Iterator.class, new RepresentIterator()); this.multiRepresenters.put(new Object[0].getClass(), new RepresentArray()); this.multiRepresenters.put(Date.class, new RepresentDate()); this.multiRepresenters.put(Enum.class, new RepresentEnum()); this.multiRepresenters.put(Calendar.class, new RepresentDate()); classTags = new HashMap<Class<? extends Object>, Tag>(); }
public SafeRepresenter() { this.nullRepresenter = new RepresentNull(); this.representers.put(String.class, new RepresentString()); this.representers.put(Boolean.class, new RepresentBoolean()); this.representers.put(Character.class, new RepresentString()); this.representers.put(UUID.class, new RepresentUuid()); this.representers.put(byte[].class, new RepresentByteArray()); Represent primitiveArray = new RepresentPrimitiveArray(); representers.put(short[].class, primitiveArray); representers.put(int[].class, primitiveArray); representers.put(long[].class, primitiveArray); representers.put(float[].class, primitiveArray); representers.put(double[].class, primitiveArray); representers.put(char[].class, primitiveArray); representers.put(boolean[].class, primitiveArray); this.multiRepresenters.put(Number.class, new RepresentNumber()); this.multiRepresenters.put(List.class, new RepresentList()); this.multiRepresenters.put(Map.class, new RepresentMap()); this.multiRepresenters.put(Set.class, new RepresentSet()); this.multiRepresenters.put(Iterator.class, new RepresentIterator()); this.multiRepresenters.put(new Object[0].getClass(), new RepresentArray()); this.multiRepresenters.put(Date.class, new RepresentDate()); this.multiRepresenters.put(Enum.class, new RepresentEnum()); this.multiRepresenters.put(Calendar.class, new RepresentDate()); classTags = new HashMap<Class<? extends Object>, Tag>(); }
public Node representData(Object data) { Class<?> type = data.getClass().getComponentType(); if (byte.class == type) { return representSequence(Tag.SEQ, asByteList(data), DumperOptions.FlowStyle.AUTO); } else if (short.class == type) { return representSequence(Tag.SEQ, asShortList(data), DumperOptions.FlowStyle.AUTO); } else if (int.class == type) { return representSequence(Tag.SEQ, asIntList(data), DumperOptions.FlowStyle.AUTO); } else if (long.class == type) { return representSequence(Tag.SEQ, asLongList(data), DumperOptions.FlowStyle.AUTO); } else if (float.class == type) { return representSequence(Tag.SEQ, asFloatList(data), DumperOptions.FlowStyle.AUTO); } else if (double.class == type) { return representSequence(Tag.SEQ, asDoubleList(data), DumperOptions.FlowStyle.AUTO); } else if (char.class == type) { return representSequence(Tag.SEQ, asCharList(data), DumperOptions.FlowStyle.AUTO); } else if (boolean.class == type) { return representSequence(Tag.SEQ, asBooleanList(data), DumperOptions.FlowStyle.AUTO); } throw new YAMLException("Unexpected primitive '" + type.getCanonicalName() + "'"); }
public Node representData(Object data) { Class<?> type = data.getClass().getComponentType(); if (byte.class == type) { return representSequence(Tag.SEQ, asByteList(data), null); } else if (short.class == type) { return representSequence(Tag.SEQ, asShortList(data), null); } else if (int.class == type) { return representSequence(Tag.SEQ, asIntList(data), null); } else if (long.class == type) { return representSequence(Tag.SEQ, asLongList(data), null); } else if (float.class == type) { return representSequence(Tag.SEQ, asFloatList(data), null); } else if (double.class == type) { return representSequence(Tag.SEQ, asDoubleList(data), null); } else if (char.class == type) { return representSequence(Tag.SEQ, asCharList(data), null); } else if (boolean.class == type) { return representSequence(Tag.SEQ, asBooleanList(data), null); } throw new YAMLException("Unexpected primitive '" + type.getCanonicalName() + "'"); }
public Node representData(Object data) { Class<?> type = data.getClass().getComponentType(); if (byte.class == type) { return representSequence(Tag.SEQ, asByteList(data), null); } else if (short.class == type) { return representSequence(Tag.SEQ, asShortList(data), null); } else if (int.class == type) { return representSequence(Tag.SEQ, asIntList(data), null); } else if (long.class == type) { return representSequence(Tag.SEQ, asLongList(data), null); } else if (float.class == type) { return representSequence(Tag.SEQ, asFloatList(data), null); } else if (double.class == type) { return representSequence(Tag.SEQ, asDoubleList(data), null); } else if (char.class == type) { return representSequence(Tag.SEQ, asCharList(data), null); } else if (boolean.class == type) { return representSequence(Tag.SEQ, asBooleanList(data), null); } throw new YAMLException("Unexpected primitive '" + type.getCanonicalName() + "'"); }