@Override protected void onStartDefinition() throws XmlParseException, XmlPullParserException, IOException { super.onStartDefinition(); String typeStr = getAttribute(TYPE, false); NumericAttributeDefinition defn = (NumericAttributeDefinition) getDefinition(); try { Type type = typeStr == null ? Type.REAL : Type.valueOf(typeStr.toUpperCase()); defn.setType(type); } catch (IllegalArgumentException e) { throw new XmlParseException(getParser(), "unknown type " + typeStr); } }
@Override protected void onStartDefinition() throws XmlParseException, XmlPullParserException, IOException { super.onStartDefinition(); String extensions = getAttribute(EXTENSIONS, false); Integer maxSize = getIntegerAttribute(MAX_SIZE, false); FileAttributeDefinition defn = (FileAttributeDefinition) getDefinition(); defn.setMaxSize(maxSize); if (extensions != null) { String[] exts = extensions.split(" "); for (String ext : exts) { defn.addExtension(ext); } } }