|
|||||||||||||||||||
| 30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| SetToMapRule.java | - | 80% | 75% | 77.8% |
|
||||||||||||||
| 1 |
/*
|
|
| 2 |
* brownies and its relative products are published under the terms
|
|
| 3 |
* of the Apache Software License.
|
|
| 4 |
*
|
|
| 5 |
* Created on 2004/08/15 17:01:04
|
|
| 6 |
*/
|
|
| 7 |
package org.asyrinx.brownie.core.xml.digester;
|
|
| 8 |
|
|
| 9 |
import java.util.Map;
|
|
| 10 |
|
|
| 11 |
import org.apache.commons.digester.Rule;
|
|
| 12 |
import org.asyrinx.brownie.core.xml.sax.SaxUtils;
|
|
| 13 |
import org.xml.sax.Attributes;
|
|
| 14 |
|
|
| 15 |
/**
|
|
| 16 |
* @author akima
|
|
| 17 |
*/
|
|
| 18 |
public class SetToMapRule extends Rule { |
|
| 19 |
|
|
| 20 |
/**
|
|
| 21 |
*
|
|
| 22 |
*/
|
|
| 23 | 1 |
public SetToMapRule() {
|
| 24 | 1 |
super();
|
| 25 |
} |
|
| 26 |
|
|
| 27 |
/**
|
|
| 28 |
* @see org.apache.commons.digester.Rule#begin(org.xml.sax.Attributes)
|
|
| 29 |
* @deprecated
|
|
| 30 |
*/
|
|
| 31 | 0 |
public void begin(Attributes attributes) throws Exception { |
| 32 | 0 |
execute(attributes); |
| 33 |
} |
|
| 34 |
|
|
| 35 |
/**
|
|
| 36 |
* @see org.apache.commons.digester.Rule#begin(java.lang.String,
|
|
| 37 |
* java.lang.String, org.xml.sax.Attributes)
|
|
| 38 |
*/
|
|
| 39 | 1 |
public void begin(String namespace, String name, Attributes attributes) throws Exception { |
| 40 | 1 |
execute(attributes); |
| 41 |
} |
|
| 42 |
|
|
| 43 |
/**
|
|
| 44 |
*/
|
|
| 45 | 1 |
private void execute(Attributes attributes) { |
| 46 | 1 |
final Map dest = (Map) digester.peek(0); |
| 47 | 1 |
SaxUtils.addToMap(attributes, dest); |
| 48 |
} |
|
| 49 |
|
|
| 50 |
} |
|
||||||||||