Changeset 1743


Ignore:
Timestamp:
2010-10-15 14:52:27 (3 years ago)
Author:
mpo
Message:

fixes #379
Adding the requested @mode for the t:variant
In a way that it aligns with @mode in t:insert
Some renaming and stuff along the way

Location:
trunk/universe
Files:
3 added
11 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/universe/kauri-template/src/main/java/org/kauriproject/template/InsertBlock.java

    r1741 r1743  
    2323import org.kauriproject.template.el.Expression; 
    2424import org.kauriproject.template.handling.Handling; 
    25 import org.kauriproject.template.handling.InsertBlockInput; 
     25import org.kauriproject.template.handling.HandlingInput; 
     26import org.kauriproject.template.handling.HandlingStrategy; 
    2627import org.kauriproject.template.source.Source; 
    2728import org.kauriproject.util.io.IOUtils; 
     
    5960    class StartStep extends Step { 
    6061 
    61         private Expression sourceExpr, valueExpr; 
    62         private String mode; 
    63         private String encoding; 
     62        private final Expression sourceExpr; 
     63        private final Expression valueExpr; 
     64        private final Expression modeExpr; 
     65        private final Expression encodingExpr; 
    6466 
    6567        public StartStep(Locator locator) { 
    6668            super(locator); 
    67             Attributes attributes = getSaxElement().getAttributes(); 
     69            final Attributes attributes = getSaxElement().getAttributes(); 
    6870 
    69             String srcAttr = attributes.getValue(SRC); 
    70             String valueAttr = attributes.getValue(VALUE); 
     71            final String srcAttr = attributes.getValue(SRC); 
     72            final String valueAttr = attributes.getValue(VALUE); 
    7173 
    7274            if(srcAttr != null) { 
    7375                sourceExpr = elFacade.createExpression(srcAttr, String.class); 
    74             }else{ 
    75                 // only read 'value' attribute if 'src' is not defined 
    76                 valueExpr = elFacade.createExpression(valueAttr, String.class);              
     76                valueExpr = null; 
     77            } else { 
     78                sourceExpr = null; 
     79                valueExpr = elFacade.createExpression(valueAttr, String.class);              
    7780            } 
    78             mode = attributes.getValue(MODE); 
    79             encoding = attributes.getValue(ENCODING); 
     81 
     82            final String modeAttr = attributes.getValue(MODE); 
     83            modeExpr = elFacade.createExpression(modeAttr, String.class); 
     84             
     85            final String encodingAttr = attributes.getValue(ENCODING); 
     86            encodingExpr = elFacade.createExpression(encodingAttr, String.class); 
    8087        } 
    8188 
    8289        @Override 
    8390        public Step executeAndProceed(ExecutionContext context, TemplateResult result) throws SAXException { 
    84             final String sourceLocation = (sourceExpr!=null ? (String) sourceExpr.evaluate(context.getTemplateContext()) : null); 
     91            final String sourceLocation = stringEval(context, sourceExpr, null); 
     92            final String encoding = stringEval(context, encodingExpr, null); 
    8593            Source source = null; 
    86             String valueStr = null; 
    87             Handling handling = null; 
    88             InsertBlockInput input = null; 
     94            CharSequence valueStr = null; 
     95            HandlingStrategy handling = null; 
     96            HandlingInput input = null; 
    8997 
    9098            try { 
     
    94102                    source = context.getSourceResolver().resolve(sourceLocation, context.getBaseUri()); 
    95103                else{ 
    96                     valueStr = (String) valueExpr.evaluate(context.getTemplateContext()); 
     104                    valueStr = (CharSequence) valueExpr.evaluate(context.getTemplateContext()); 
    97105                }    
    98106 
    99107                // decide on handling mode based on @mode, media-type or default 
    100                 if (mode != null) { 
     108                if (modeExpr != null) { 
     109                    final String mode = (String)modeExpr.evaluate(context.getTemplateContext()); 
    101110                    handling = Handling.fromMode(mode);  // this is silent about unknown modes 
    102111                } 
     
    109118                 
    110119                //actually insert 
    111                 input = InsertBlockInput.newInput(source, valueStr, encoding); 
     120                input = HandlingInput.newInput(source, encoding, valueStr); 
    112121                handling.doInsert(input, result, parser); // this could NPE when parseType was still not found 
    113122 
    114123            } catch (FileNotFoundException ex) { 
    115                 throw new TemplateException("Error inserting " + handling.name() + "(mode) from " + (sourceLocation != null ? sourceLocation : valueStr) + ": " + ex); 
     124                throw new TemplateException("Error inserting from " + (sourceLocation != null ? sourceLocation : valueStr) + " using " + handling + " : " + ex); 
    116125            } catch (Exception ex) { 
    117                 throw new TemplateException("Error parsing " + handling.name() + "(mode) from " + (sourceLocation != null ? sourceLocation : valueStr) + ": " + ex); 
     126                throw new TemplateException("Error parsing from " + (sourceLocation != null ? sourceLocation : valueStr) + " using " + handling + " : " + ex); 
    118127            } finally { 
    119128                if (source != null) { 
     
    133142            super(locator); 
    134143        } 
    135  
    136144    } 
    137145} 
  • trunk/universe/kauri-template/src/main/java/org/kauriproject/template/TemplateBlock.java

    r1350 r1743  
    1616package org.kauriproject.template; 
    1717 
     18import org.kauriproject.template.el.Expression; 
    1819import org.xml.sax.Locator; 
    1920 
     
    5758        return saxElement; 
    5859    } 
    59  
     60     
     61    public String stringEval(final ExecutionContext context, final Expression expr, final String dfault) { 
     62        return expr != null ? (String)expr.evaluate(context.getTemplateContext()): dfault; 
     63    } 
    6064} 
  • trunk/universe/kauri-template/src/main/java/org/kauriproject/template/VariableBlock.java

    r1741 r1743  
    1616package org.kauriproject.template; 
    1717 
    18 import java.io.*; 
    19  
    20 import org.codehaus.jackson.map.ObjectMapper; 
     18import java.io.ByteArrayOutputStream; 
     19import java.io.IOException; 
     20 
     21import javax.xml.parsers.SAXParser; 
     22 
    2123import org.kauriproject.template.KauriSaxHandler.OutputFormat; 
    22 import org.kauriproject.template.el.CompositeExpression; 
    2324import org.kauriproject.template.el.ELFacade; 
    2425import org.kauriproject.template.el.Expression; 
     26import org.kauriproject.template.handling.Handling; 
     27import org.kauriproject.template.handling.HandlingInput; 
    2528import org.kauriproject.template.source.Source; 
    26 import org.kauriproject.util.xml.LocalDocumentBuilderFactory; 
    27 import org.kauriproject.util.xml.XmlMediaTypeHelper; 
    2829import org.kauriproject.util.io.IOUtils; 
    2930import org.xml.sax.Attributes; 
    3031import org.xml.sax.Locator; 
    3132import org.xml.sax.SAXException; 
    32 import org.w3c.dom.Document; 
    3333 
    3434/** 
     
    4545    private static final String MODE = "mode"; 
    4646 
    47     // EL 
     47    // EL support 
    4848    private ELFacade elFacade; 
     49     
     50    // XML support 
     51    protected SAXParser parser; 
     52 
    4953 
    5054    public VariableBlock(ELFacade elFacade, SaxElement saxElement) { 
     
    6771        // variable stuff 
    6872        private final String name; 
    69         private final Expression valueExpression; 
    70         private final Expression srcExpression; 
    71         private final Expression acceptExpression; 
    72         private final CompositeExpression modeExpression; 
     73        private final Expression valueExpr; 
     74        private final Expression srcExpr; 
     75        private final Expression acceptExpr; 
     76        private final Expression modeExpr; 
    7377        private final boolean overwrite; 
    7478 
     
    8286            name = attributes.getValue(NAME); 
    8387 
    84             String expression = attributes.getValue(VALUE); 
    85             if (expression != null) { 
    86                 valueExpression = elFacade.createExpression(expression, Object.class); 
    87             } else { 
    88                 valueExpression = null; 
    89             } 
    90  
    91             String src = attributes.getValue(SRC); 
    92             if (src != null) { 
    93                 srcExpression = elFacade.createExpression(src, String.class); 
    94             } else { 
    95                 srcExpression = null; 
    96             } 
    97  
    98             String accept = attributes.getValue(ACCEPT); 
    99             if (accept != null) { 
    100                 acceptExpression = elFacade.createExpression(accept, String.class); 
    101             } else { 
    102                 acceptExpression = null; 
    103             } 
    104  
    105             String mode = attributes.getValue(MODE); 
    106             if (mode != null) { 
    107                 modeExpression = elFacade.createExpression(accept, String.class); 
    108             } else { 
    109                 modeExpression = null; 
    110             } 
     88            final String valAttr = attributes.getValue(VALUE); 
     89            valueExpr = elFacade.createExpression(valAttr, Object.class); 
     90 
     91            final String srcAttr = attributes.getValue(SRC); 
     92            srcExpr = elFacade.createExpression(srcAttr, String.class); 
     93 
     94            final String acceptAttr = attributes.getValue(ACCEPT); 
     95            acceptExpr = elFacade.createExpression(acceptAttr, String.class); 
     96 
     97            final String modeAttr = attributes.getValue(MODE); 
     98            modeExpr = elFacade.createExpression(modeAttr, String.class); 
    11199 
    112100            overwrite = !"false".equalsIgnoreCase(attributes.getValue(OVERWRITE)); 
     
    119107            if (overwrite || !tmplContext.containsKey(name)) { 
    120108                Object value = NO_VALUE;  // use our own null to differentiate from null 
    121                 if (valueExpression != null) { 
    122                     value = valueExpression.evaluate(context.getTemplateContext()); 
     109                if (valueExpr != null) { 
     110                    value = valueExpr.evaluate(context.getTemplateContext()); 
    123111                } else { 
    124112                    // use element body as value 
     
    149137 
    150138                // value retrieved from @value or body can be overwritten by loaded data from @src 
    151                 if (srcExpression != null) { 
    152                     value = loadFromSrc(context, value); 
    153                 } 
    154  
     139                value = overideFromSrc(context, value); 
     140                 
    155141                value = (value == NO_VALUE) ? null : value; // switch tracking NO_VALUE back to null before setting it in the context 
    156142                tmplContext.put(name, value); 
     
    160146        } 
    161147 
    162         private Object loadFromSrc(ExecutionContext context, Object fallbackValue) { 
    163             String src = (String)srcExpression.evaluate(context.getTemplateContext()); 
    164             String accept = acceptExpression != null ? (String)acceptExpression.evaluate(context.getTemplateContext()) : null; 
     148        private Object overideFromSrc(final ExecutionContext context, final Object value) { 
     149            final String src = stringEval(context, srcExpr, null); 
     150            final String accept = stringEval(context, acceptExpr, null); 
     151 
    165152            Source source = null; 
     153            HandlingInput input = null; 
     154            Handling handling = null; 
    166155            try { 
    167                 source = context.getSourceResolver().resolve(src, context.getBaseUri(), accept); 
    168  
    169                 final String mode = null; 
    170  
    171                 if (source.getMediaType().equals("application/json")) { 
    172                     return loadJSON(source); 
    173                 } else if (XmlMediaTypeHelper.isXmlMediaType(source.getMediaType())) { 
    174                     return loadXml(source); 
    175                 } else { 
    176                     return loadString(source); 
    177                 } 
     156                source = (src == null) ? null : context.getSourceResolver().resolve(src, context.getBaseUri(), accept); 
     157 
     158                // decide on handling mode based on @mode, media-type or default 
     159                if (modeExpr != null) { 
     160                    final String mode = (String)modeExpr.evaluate(context.getTemplateContext()); 
     161                    handling = Handling.fromMode(mode);  // this is silent about unknown modes 
     162                } 
     163                 
     164                if (source != null) { 
     165                    input = HandlingInput.newInput(source); 
     166                    if (handling == null) {  
     167                        handling = Handling.fromMediaType(source.getMediaType()); 
     168                    } 
     169                } else if (value instanceof CharSequence) { 
     170                    input = HandlingInput.newInput(null, null, (CharSequence)value); 
     171                } else if (value == NO_VALUE) { 
     172                    throw new TemplateException("No practical source or value found for variable " + name + ". Tried URI " + src);     
     173                } else 
     174                    return value; 
     175                 
     176                if (handling == null) {  
     177                    handling = Handling.TXT; // default to txt mode to be sure to include something 
     178                } 
     179                return handling.parseToObject(input);                 
    178180            } catch (Throwable e) { 
    179                 if (fallbackValue != NO_VALUE) 
    180                     return fallbackValue; 
     181                if (value == NO_VALUE) 
     182                    throw new TemplateException("Some error occured while loading data for variable " + name + " from URI " + src, e);     
    181183                // else 
    182                 throw new TemplateException("Some error occured while loading data for variable " + name + " from URI " + src, e); 
     184                return value; 
    183185            } finally { 
    184186                if (source != null) { 
    185187                    source.release(); 
    186188                } 
     189                IOUtils.closeQuietly(input); 
    187190            } 
    188         } 
    189  
    190         private Object loadJSON(Source source) throws IOException { 
    191             //String jsonText = loadString(source); 
    192             ObjectMapper mapper = new ObjectMapper();  
    193             InputStream is = source.getInputStream(); 
    194             Object obj = mapper.readValue(is, Object.class); 
    195             is.close(); 
    196             return obj; 
    197         } 
    198  
    199         private Document loadXml(Source source) throws IOException, SAXException { 
    200             InputStream is = null; 
    201             try { 
    202                 is = source.getInputStream(); 
    203                 return LocalDocumentBuilderFactory.getBuilder().parse(is); 
    204             } finally { 
    205                 IOUtils.closeQuietly(is); 
    206             } 
    207         } 
    208  
    209         private String loadString(Source source) throws IOException { 
    210             StringWriter writer = new StringWriter(); 
    211             source.write(writer); 
    212             return writer.toString(); 
    213191        } 
    214192    } 
  • trunk/universe/kauri-template/src/main/java/org/kauriproject/template/el/ELFacade.java

    r1058 r1743  
    4646 
    4747    public CompositeExpression createExpression(String expression, Class<?> expectedType) { 
     48        if (expression == null )  
     49            return null; 
    4850        CompositeExpression cex = new CompositeExpression(); 
    4951        parseExpression(expression, expectedType, cex); 
  • trunk/universe/kauri-template/src/main/java/org/kauriproject/template/handling/HTMLHandlingStrategy.java

    r1741 r1743  
    55import javax.xml.parsers.SAXParser; 
    66 
    7 import org.kauriproject.template.TemplateResult; 
     7import org.kauriproject.util.xml.LocalDocumentBuilderFactory; 
     8import org.kauriproject.xml.html.HtmlBodyContentsFilter; 
    89import org.kauriproject.xml.html.NekoHtmlParser; 
    9 import org.kauriproject.xml.html.HtmlBodyContentsFilter; 
     10import org.w3c.dom.Document; 
     11import org.xml.sax.ContentHandler; 
    1012import org.xml.sax.SAXException; 
    1113 
    12 class HTMLHandlingStrategy implements HandlingStrategy { 
    13     public void doInsert(InsertBlockInput input, final TemplateResult result, SAXParser parser) throws SAXException, IOException { 
    14            
     14import com.sun.org.apache.xml.internal.utils.DOMBuilder; 
     15 
     16public class HTMLHandlingStrategy implements HandlingStrategy { 
     17     
     18    public void doInsert(HandlingInput input, final ContentHandler result, SAXParser parser) throws SAXException, IOException { 
    1519        //TODO check proper namespace-handling and correctly marking html to xhtml spaced elements 
    1620        // will be important for post-processing 
     
    1923             
    2024    } 
     25 
     26    public Object parseToObject(HandlingInput input) throws SAXException, IOException { 
     27 
     28            final Document doc = LocalDocumentBuilderFactory.newDocument(); 
     29            final DOMBuilder result = new DOMBuilder(doc); 
     30             
     31            NekoHtmlParser neko = new NekoHtmlParser(); 
     32            neko.parse(input.getInputSource(), result); 
     33 
     34            return doc; 
     35    } 
    2136} 
  • trunk/universe/kauri-template/src/main/java/org/kauriproject/template/handling/Handling.java

    r1741 r1743  
    55import javax.xml.parsers.SAXParser; 
    66 
    7 import org.kauriproject.template.TemplateResult; 
    87import org.kauriproject.util.xml.XmlMediaTypeHelper; 
     8import org.xml.sax.ContentHandler; 
    99import org.xml.sax.SAXException; 
    1010 
    1111public enum Handling implements HandlingStrategy{ 
    1212    XML("xml", new XMLHandlingStrategy()),  
     13    JSON("json", new JSONHandlingStrategy()), 
    1314    TXT("txt", new TextHandlingStrategy()), 
    1415    HTML("html", new HTMLHandlingStrategy()); 
     
    2223    } 
    2324     
    24     public void doInsert(InsertBlockInput input, TemplateResult result, SAXParser parser) throws IOException, SAXException{ 
     25    public void doInsert(HandlingInput input, ContentHandler result, SAXParser parser) throws IOException, SAXException{ 
    2526        this.strategy.doInsert(input, result, parser); 
     27    } 
     28 
     29    public Object parseToObject(HandlingInput input) throws IOException, SAXException { 
     30        return this.strategy.parseToObject(input); 
    2631    } 
    2732     
     
    3742        if (XmlMediaTypeHelper.isXmlMediaType(mime)) { 
    3843            return XML; 
     44        } else if (mime.equals("application/json")) { 
     45            return JSON; 
    3946        } else if (mime.startsWith("text/html")) { 
    4047            return HTML; 
     
    4552        } 
    4653    } 
     54 
    4755} 
  • trunk/universe/kauri-template/src/main/java/org/kauriproject/template/handling/HandlingInput.java

    r1741 r1743  
    1313import org.xml.sax.InputSource; 
    1414 
    15 public class InsertBlockInput implements Closeable { 
    16      
     15public class HandlingInput implements Closeable { 
     16 
    1717    private final Reader reader; 
    18      
    19     InsertBlockInput(final InputStream is, final String encoding) throws UnsupportedEncodingException { 
    20         this( encoding == null ? new InputStreamReader(is) : new InputStreamReader(is, encoding)); 
     18 
     19    HandlingInput(final InputStream is, final String encoding) throws UnsupportedEncodingException { 
     20        this(encoding == null ? new InputStreamReader(is) : new InputStreamReader(is, encoding)); 
    2121    } 
    22      
    23     InsertBlockInput(final Reader reader) { 
     22 
     23    HandlingInput(final Reader reader) { 
    2424        this.reader = reader; 
    2525    } 
    26      
    27     public static InsertBlockInput newInput(final Source source, final String valueStr, String encoding) throws UnsupportedEncodingException, IOException { 
    28         if (source == null ){ 
     26 
     27    public static HandlingInput newInput(final Source source, final String encoding, final CharSequence valueStr) 
     28            throws UnsupportedEncodingException, IOException { 
     29        if (source == null) { 
    2930            // we read from the string, no encoding to be followed 
    30             final Reader input = new StringReader(valueStr); 
    31             return new InsertBlockInput(input); 
    32         }  
    33         //else  
    34         if (encoding == null) //if nothing specified, let source charset decide 
     31            final Reader input = new StringReader(valueStr.toString()); 
     32            return new HandlingInput(input); 
     33        } 
     34        // else 
     35        return newInput(source, encoding); 
     36    } 
     37 
     38    public static HandlingInput newInput(final Source source, String encoding) throws IOException, 
     39            UnsupportedEncodingException { 
     40        if (encoding == null) // if nothing specified, let source charset decide 
    3541            encoding = source.getEncoding(); 
    36          
     42 
    3743        final InputStream input = source.getInputStream(); 
    38         return new InsertBlockInput(input, encoding); 
     44        return new HandlingInput(input, encoding); 
    3945    } 
    40      
     46 
     47    public static HandlingInput newInput(final Source source) throws IOException, 
     48            UnsupportedEncodingException { 
     49 
     50        final InputStream input = source.getInputStream(); 
     51        return new HandlingInput(input, source.getEncoding()); 
     52    } 
     53 
    4154    InputSource getInputSource() { 
    4255        return new InputSource(reader); 
     
    4659        return reader; 
    4760    } 
    48      
     61 
    4962    public void close() { 
    5063        IOUtils.closeQuietly(reader); 
  • trunk/universe/kauri-template/src/main/java/org/kauriproject/template/handling/HandlingStrategy.java

    r1741 r1743  
    55import javax.xml.parsers.SAXParser; 
    66 
    7 import org.kauriproject.template.TemplateResult; 
     7import org.xml.sax.ContentHandler; 
    88import org.xml.sax.SAXException; 
    99 
    1010public interface HandlingStrategy { 
    11     void doInsert(InsertBlockInput input, TemplateResult result, SAXParser parser) throws IOException, SAXException; 
     11    void doInsert(HandlingInput input, ContentHandler result, SAXParser parser) throws IOException, SAXException; 
     12    Object parseToObject(HandlingInput input) throws IOException, SAXException; 
     13 
    1214} 
  • trunk/universe/kauri-template/src/main/java/org/kauriproject/template/handling/TextHandlingStrategy.java

    r1741 r1743  
    33import java.io.IOException; 
    44import java.io.Reader; 
     5import java.io.StringWriter; 
    56 
    67import javax.xml.parsers.SAXParser; 
    78 
    8 import org.kauriproject.template.TemplateResult; 
     9import org.xml.sax.ContentHandler; 
    910import org.xml.sax.SAXException; 
    1011 
    1112class TextHandlingStrategy implements HandlingStrategy { 
    12     public void doInsert(InsertBlockInput input, final TemplateResult result, SAXParser parser) throws IOException, SAXException { 
     13    public void doInsert(HandlingInput input, final ContentHandler result, SAXParser parser) throws IOException, SAXException { 
    1314         
    1415        //TODO check encoding used to read the text! -- possibly allow encoding to be specified or read from inputstream? 
     
    2122        } 
    2223    } 
     24 
     25    public Object parseToObject(HandlingInput input) throws SAXException, IOException { 
     26        StringWriter writer = new StringWriter(); 
     27         
     28        //TODO reconsider this: sources can write to streams directly maybe some input.writeTo() 
     29         
     30        Reader reader = input.getReader(); 
     31        char[] buf = new char[1024]; 
     32        int read = -1; 
     33        while ( (read = reader.read(buf)) > 0) { 
     34            writer.write(buf, 0, read); 
     35        } 
     36        return writer.toString(); 
     37    } 
    2338} 
  • trunk/universe/kauri-template/src/main/java/org/kauriproject/template/handling/XMLHandlingStrategy.java

    r1741 r1743  
    55import javax.xml.parsers.SAXParser; 
    66 
    7 import org.kauriproject.template.TemplateResult; 
     7import org.kauriproject.util.io.IOUtils; 
     8import org.kauriproject.util.xml.LocalDocumentBuilderFactory; 
    89import org.kauriproject.xml.sax.EmbedXmlFilter; 
    910import org.kauriproject.xml.sax.XmlConsumer; 
     11import org.xml.sax.ContentHandler; 
     12import org.xml.sax.InputSource; 
    1013import org.xml.sax.SAXException; 
    1114import org.xml.sax.XMLReader; 
    1215 
    1316class XMLHandlingStrategy implements HandlingStrategy { 
    14     public void doInsert(InsertBlockInput input, final TemplateResult result, final SAXParser parser) throws IOException, SAXException { 
     17    public void doInsert(HandlingInput input, final ContentHandler result, final SAXParser parser) throws IOException, SAXException { 
    1518        // default to XML: parse with saxparser 
    1619        XmlConsumer consumer = new EmbedXmlFilter(result); 
     
    2023        xmlReader.parse(input.getInputSource()); 
    2124    } 
     25 
     26    public Object parseToObject(HandlingInput input) throws SAXException, IOException { 
     27        InputSource is = null; 
     28        try { 
     29            is = input.getInputSource(); 
     30            return LocalDocumentBuilderFactory.getBuilder().parse(is); 
     31        } finally { 
     32            IOUtils.closeQuietly(input); 
     33        } 
     34    } 
    2235} 
  • trunk/universe/kauri-template/src/test/java/org/kauriproject/template/TemplateExecutionTest.java

    r1737 r1743  
    193193        testFlow("/org/kauriproject/template/jsonvariables.xml", true); 
    194194    } 
     195 
     196    public void testModeHandling() throws Exception { 
     197        testFlow("/org/kauriproject/template/mode_handling.xml", true); 
     198    } 
     199 
    195200} 
  • trunk/universe/kauri-xmlcore/src/main/java/org/kauriproject/xml/html/HtmlBodyContentsFilter.java

    r1741 r1743  
    77 
    88public class HtmlBodyContentsFilter implements ContentHandler { 
    9     private ContentHandler consumer; 
     9    private final ContentHandler consumer; 
    1010    private int depthInBody = 0; 
    1111     
    12     public HtmlBodyContentsFilter(ContentHandler consumer) { 
     12    public HtmlBodyContentsFilter(final ContentHandler consumer) { 
    1313        this.consumer = consumer; 
    1414    } 
Note: See TracChangeset for help on using the changeset viewer.