public AbstractAttributedCharacterIteratorAttributeConverter(final Class type) { super(); if (!AttributedCharacterIterator.Attribute.class.isAssignableFrom(type)) { throw new IllegalArgumentException(type.getName() + " is not a " + AttributedCharacterIterator.Attribute.class.getName()); } this.type = type; readResolve(); }
AttributedCharacterIterator.Attribute attribute = (AttributedCharacterIterator.Attribute)Fields.read(fields[i], null); attributeMap.put(toString(attribute), attribute);
public String toString(final Object source) { return getName((AttributedCharacterIterator.Attribute)source); }
public AbstractAttributedCharacterIteratorAttributeConverter(final Class type) { super(); this.type = type; readResolve(); }
private Object readResolve() { fieldDictionary = new FieldDictionary(); attributeMap = new HashMap(); for (final Iterator iterator = fieldDictionary.fieldsFor(type); iterator .hasNext();) { final Field field = (Field)iterator.next(); if (field.getType() == type && Modifier.isStatic(field.getModifiers())) { try { final Object attribute = field.get(null); attributeMap.put(toString(attribute), attribute); } catch (IllegalAccessException e) { throw new ObjectAccessException("Cannot get object of " + field, e); } } } return this; }
@Override public String toString(final Object source) { @SuppressWarnings("unchecked") final T t = (T)source; return getName(t); }
public AbstractAttributedCharacterIteratorAttributeConverter(final Class type) { super(); this.type = type; readResolve(); }
private Object readResolve() { fieldDictionary = new FieldDictionary(); attributeMap = new HashMap(); for (final Iterator iterator = fieldDictionary.fieldsFor(type); iterator .hasNext();) { final Field field = (Field)iterator.next(); if (field.getType() == type && Modifier.isStatic(field.getModifiers())) { try { final Object attribute = field.get(null); attributeMap.put(toString(attribute), attribute); } catch (IllegalAccessException e) { throw new ObjectAccessException("Cannot get object of " + field, e); } } } return this; }
public String toString(final Object source) { return getName((AttributedCharacterIterator.Attribute)source); }
public AbstractAttributedCharacterIteratorAttributeConverter(final Class type) { super(); this.type = type; readResolve(); }
private Object readResolve() { fieldDictionary = new FieldDictionary(); attributeMap = new HashMap(); for (final Iterator iterator = fieldDictionary.fieldsFor(type); iterator .hasNext();) { final Field field = (Field)iterator.next(); if (field.getType() == type && Modifier.isStatic(field.getModifiers())) { try { final Object attribute = field.get(null); attributeMap.put(toString(attribute), attribute); } catch (IllegalAccessException e) { throw new ObjectAccessException("Cannot get object of " + field, e); } } } return this; }
public String toString(final Object source) { return getName((AttributedCharacterIterator.Attribute)source); }
public AbstractAttributedCharacterIteratorAttributeConverter(final Class type) { super(); if (!AttributedCharacterIterator.Attribute.class.isAssignableFrom(type)) { throw new IllegalArgumentException(type.getName() + " is not a " + AttributedCharacterIterator.Attribute.class.getName()); } this.type = type; readResolve(); }
AttributedCharacterIterator.Attribute attribute = (AttributedCharacterIterator.Attribute)Fields.read(fields[i], null); attributeMap.put(toString(attribute), attribute);
public String toString(final Object source) { return getName((AttributedCharacterIterator.Attribute)source); }
public AbstractAttributedCharacterIteratorAttributeConverter(final Class<? extends T> type) { super(); if (!AttributedCharacterIterator.Attribute.class.isAssignableFrom(type)) { throw new IllegalArgumentException(type.getName() + " is not a " + AttributedCharacterIterator.Attribute.class.getName()); } this.type = type; readResolve(); }
AttributedCharacterIterator.Attribute attribute = (AttributedCharacterIterator.Attribute)Fields.read(fields[i], null); attributeMap.put(toString(attribute), attribute);
public String toString(final Object source) { return getName((AttributedCharacterIterator.Attribute)source); }
public AbstractAttributedCharacterIteratorAttributeConverter(final Class type) { super(); if (!AttributedCharacterIterator.Attribute.class.isAssignableFrom(type)) { throw new IllegalArgumentException(type.getName() + " is not a " + AttributedCharacterIterator.Attribute.class.getName()); } this.type = type; readResolve(); }
AttributedCharacterIterator.Attribute attribute = (AttributedCharacterIterator.Attribute)Fields.read(fields[i], null); attributeMap.put(toString(attribute), attribute);