Code example for AttributeList

Methods: getValue

0
			super.endDocument(); 
		} 
		 
		@Override 
		public void startElement(String localName, AttributeList atts) throws SAXException {
			System.out.println("e621api: xml parser tag found ID " + atts.getValue("id"));
			super.startElement(localName, atts);
			post = new postObject();
			 
			try { 
				try {post.setFile_size(Integer.valueOf(atts.getValue("file_size")));}catch(NumberFormatException e){post.setFile_size(0);}
				try {post.setId(Integer.valueOf(atts.getValue("id")));}catch(NumberFormatException e){post.setId(0);}
				try {post.setParent_id(Integer.valueOf(atts.getValue("parent_id")));}catch(NumberFormatException e){post.setParent_id(0);}
				try {post.setCreator_id(Integer.valueOf(atts.getValue("creator_id")));}catch(NumberFormatException e){post.setCreator_id(0);}
				try {post.setHeight(Integer.valueOf(atts.getValue("height")));}catch(NumberFormatException e){post.setHeight(0);}
				try {post.setWidth(Integer.valueOf(atts.getValue("width")));}catch(NumberFormatException e){post.setWidth(0);}
				try {post.setSample_height(Integer.valueOf(atts.getValue("sample_height")));}catch(NumberFormatException e){post.setSample_height(0);}
				try {post.setSample_width(Integer.valueOf(atts.getValue("sample_width")));}catch(NumberFormatException e){post.setSample_width(0);}
				try {post.setPreview_height(Integer.valueOf(atts.getValue("preview_height")));}catch(NumberFormatException e){post.setPreview_height(0);}
				try {post.setPreview_width(Integer.valueOf(atts.getValue("preview_width")));}catch(NumberFormatException e){post.setPreview_width(0);}
				try {post.setChange(Integer.valueOf(atts.getValue("change")));}catch(NumberFormatException e){post.setChange(0);}
				try {post.setScore(Integer.valueOf(atts.getValue("score")));}catch(NumberFormatException e){post.setScore(0);}
			 
				post.setMd5(atts.getValue("md5"));