/** * Attempts to turn an attribute into an integer. */ public static int toInt (final ApplicationContext context, Attribute a) { if (a == null) { throw new IllegalArgumentException ("cannot turn a null attribute into an int"); } if (log.isDebugEnabled()) log.debug("toInt() a.class is "+a.getClass().getName()); if (a instanceof XmlAttribute) { final Attribute a2 = ((XmlAttribute)a).getAttributeContent(context); if (a2 != null) a = a2; } if (a instanceof IntegerAttribute) return ((IntegerAttribute)a).intValue(); return Integer.parseInt(a.toString()); }