1 42 43 package org.jfree.xml.attributehandlers; 44 45 import org.jfree.util.Log; 46 47 51 public class IntegerAttributeHandler implements AttributeHandler { 52 53 56 public IntegerAttributeHandler() { 57 super(); 58 } 59 60 67 public String toAttributeValue(final Object o) { 68 try { 69 final Integer in = (Integer ) o; 70 return in.toString(); 71 } 72 catch (ClassCastException cce) { 73 if (o != null) { 74 Log.debug("ClassCastException: Expected Integer, found " + o.getClass()); 75 } 76 throw cce; 77 } 78 } 79 80 87 public Object toPropertyValue(final String s) { 88 return new Integer (s); 89 } 90 } 91 | Popular Tags |