Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package jpaoletti.jpm.parser;
 

Author(s):
jpaoletti
public abstract class ParserSupport implements PMParser {
    private XStream xstream;
    private PresentationManager pm;
    public ParserSupport(PresentationManager pm) {
        this. = pm;
    }
    protected void init() {
         = new XStream(new JDomDriver());
    }
    @Override
    public Object parseFile(String filenamethrows Exception {
        init();
        final InputStream is = ResourceManager.getInputStream(filename);
        final Object result = .fromXML(new InputStreamReader(is), newObject());
        afterParse(result);
        return result;
    }
    @Override
    public void saveToFile(Object objectString filenamethrows Exception {
        init();
        //todo finish
        .toXML(object);
    }
    public XStream getXstream() {
        return ;
    }
    protected abstract Object newObject();
    public PresentationManager getPm() {
        return ;
    }
    protected void afterParse(Object result) {
    }
New to GrepCode? Check out our FAQ X