Code example for Attributes

Methods: getValue

0
    		String articleCount = atts.getValue("total_articles");
    		if(!TextUtils.isEmpty(articleCount)) {
    			mArticleCount = Integer.parseInt(articleCount);
    		}   		 
    	} else if (name.equals("article")) {
            mCurrentDrink = new Drink(Integer.parseInt(atts.getValue("id").trim()));
        } else if (name.equals("supplier") && !TextUtils.isEmpty(atts.getValue("url").trim())) {
            mCurrentDrink.setSupplierUrl(atts.getValue("url").trim());
        } else if (name.equals("volume")) {
            mCurrentVolume = new Volume();
            String articleId = atts.getValue("sb_article_id").trim();
            if (!TextUtils.isEmpty(articleId)) {
                mCurrentVolume.setArticleId(Integer.parseInt(articleId));
            } 
            mCurrentVolume.setPriceSek(atts.getValue("price").trim());
            mCurrentVolume.setRetired(Integer.parseInt(atts.getValue("retired").trim()));
        } else if (name.equals("tag")) {
        	mCurrentTag = new Tag();
        	mCurrentTag.setId(Integer.parseInt(atts.getValue("id")));
        	mCurrentTag.setType(atts.getValue("type"));
        } else if (name.equals("producer")) {
        	String producerId = atts.getValue("id");
        	if(producerId != null) {
        		mCurrentDrink.setProducerId(Integer.parseInt(producerId.trim()));
        	} else { 
        		mCurrentDrink.setProducerId(Producer.UNDEFINED_ID);
        	}