/*
 * XMLObjectParser.java
 *
 * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
 *
 * This file is part of BEAST.
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership and licensing.
 *
 * BEAST is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 *  BEAST is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with BEAST; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA  02110-1301  USA
 */

package dr.xml;

public interface XMLObjectParser {

	/**
	 * @param store contains all named objects that have already been parsed.
	 */
	Object parseXMLObject(XMLObject xo, String id, ObjectStore store) throws XMLParseException;

	String getParserName();

    String[] getParserNames();

	String getParserDescription();

	boolean hasExample();

	String getExample();


	/**
	 * @return a description of this parser as HTML.
	 */
	String toHTML(XMLDocumentationHandler handler);

	String toWiki(XMLDocumentationHandler handler);
	
	Class getReturnType();

	XMLSyntaxRule[] getSyntaxRules();
}

@@ -1026,22 +1026,176 @@
 rser %7B%0A%0A
-%09/**%0A%09
+    /**%0A     *%0A     * @return  (Java) class of parsed element (i.e. class of object retuned in  parseXMLObject)%0A     */%0A    Class getReturnType();%0A%0A    /**%0A    
  * @para
@@ -1260,22 +1260,28 @@
 parsed.%0A
-%09 */%0A%09
+     */%0A    
 Object p
@@ -1369,124 +1369,579 @@
 n;%0A%0A
-%09String getParserName();%0A%0A    String%5B%5D getParserNames();%0A%0A%09String getParserDescription();%0A%0A%09boolean hasExample();%0A%0A%09
+    /**%0A     *%0A     * @return Parser name, which is identical to name of xml element parsed by it.%0A     */%0A    String getParserName();%0A%0A    /**%0A     *%0A     * @return A list of parser name synonyms (including name returned by getParserName)%0A     */%0A    String%5B%5D getParserNames();%0A%0A    /**%0A     *%0A     * @return  Human readable description of xml element parsed by parser.%0A     */%0A    String getParserDescription();%0A%0A    /**%0A     *%0A     * @return true if an example is available.%0A     */%0A    boolean hasExample();%0A%0A    /**%0A     *%0A     * @return element example%0A     */%0A    
 Stri
@@ -1963,14 +1963,20 @@
 ;%0A%0A%0A
-%09/**%0A%09
+    /**%0A    
  * @
@@ -2024,14 +2024,20 @@
 ML.%0A
-%09 */%0A%09
+     */%0A    
 Stri
@@ -2081,17 +2081,20 @@
 dler);%0A%0A
-%09
+    
 String t
@@ -2137,36 +2137,127 @@
 r);%0A
-%09%0A%09Class getReturnType();%0A%0A%09
+%0A%0A    /**%0A     * @return an array of syntax rules required by this element.%0A     * Order is not important.%0A     */%0A    
 XMLS

add comments