@Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if (TagType.ROOT.equals(qName)) { for (int i = 0; i < attributes.getLength(); i++) { if (CLASS_NAME_ATTR_NAME.equalsIgnoreCase(attributes.getQName(i))) { rootTag.setClassName(attributes.getValue(i)); } else if (CLASS_COMMENT_ATTR_NAME.equalsIgnoreCase(attributes.getQName(i))) { rootTag.setClassComment(attributes.getValue(i)); } } setCustomRootTagValue(rootTag, attributes); } else { if (TagType.ITEMS.equals(qName)) { ItemsTag itemsTag = instanceItemsTag(); for (int i = 0; i < attributes.getLength(); i++) { if (UPPER_ALL_ATTR_NAME.equalsIgnoreCase(attributes.getQName(i))) { itemsTag.setUpperAll(attributes.getValue(i)); } else if (UPPER_CAMEL_ATTR_NAME.equalsIgnoreCase(attributes.getQName(i))) { itemsTag.setUpperCamel(attributes.getValue(i)); } else if (UPPER_SNAKE_ATTR_NAME.equalsIgnoreCase(attributes.getQName(i))) { itemsTag.setUpperSnake(attributes.getValue(i)); } else if (LOWER_ALL_ATTR_NAME.equalsIgnoreCase(attributes.getQName(i))) { itemsTag.setLowerAll(attributes.getValue(i)); } else if (LOWER_CAMEL_ATTR_NAME.equalsIgnoreCase(attributes.getQName(i))) { itemsTag.setLowerCamel(attributes.getValue(i)); } else if (LOWER_SNAKE_ATTR_NAME.equalsIgnoreCase(attributes.getQName(i))) { itemsTag.setLowerSnake(attributes.getValue(i)); } else if (SEPARATOR_ATTR_NAME.equalsIgnoreCase(attributes.getQName(i))) { itemsTag.setSeparator(attributes.getValue(i)); } else if (END_ATTR_NAME.equalsIgnoreCase(attributes.getQName(i))) { itemsTag.setEnd(attributes.getValue(i)); } } setCustomItemsTagValue(itemsTag, attributes); itemsTags.add(itemsTag); } else if (TagType.DELETE.equals(qName)) { DeleteTag tag = new DeleteTag(); deleteTags.add(tag); } } }
@Override public void interchange(ItemsTag srcTag) { super.interchange(srcTag); setCode(((EnumItemsTag) srcTag).getCode()); }