1   /****************************************************************************
2    * This demo file is part of yFiles for Java 2.14.
3    * Copyright (c) 2000-2017 by yWorks GmbH, Vor dem Kreuzberg 28,
4    * 72070 Tuebingen, Germany. All rights reserved.
5    * 
6    * yFiles demo files exhibit yFiles for Java functionalities. Any redistribution
7    * of demo files in source code or binary form, with or without
8    * modification, is not permitted.
9    * 
10   * Owners of a valid software license for a yFiles for Java version that this
11   * demo is shipped with are allowed to use the demo source code as basis
12   * for their own yFiles for Java powered applications. Use of such programs is
13   * governed by the rights and conditions as set out in the yFiles for Java
14   * license agreement.
15   * 
16   * THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED
17   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18   * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
19   * NO EVENT SHALL yWorks BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
21   * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22   * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23   * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24   * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25   * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26   *
27   ***************************************************************************/
28  package demo.layout.genealogy.iohandler;
29  
30  /**
31   * Handles data from a GEDCOM file input.
32   * <p/>
33   * As the GEDCOM standard defines a format with a tree structure, this handler provides some callbacks to react to the
34   * start and end of a level and the input as well. Because of these callbacks the handler does not have to take care of
35   * the hierarchic structure.
36   */
37  public interface GedcomInputHandler {
38  
39    /**
40     * Callback to handle the begin of the GEDCOM file.
41     */
42    public void handleStartDocument();
43  
44    /**
45     * Callback to handle the end of the GEDCOM file.
46     */
47    public void handleEndDocument();
48  
49    /**
50     * Callback to handle the begin of a new level labeled by a given tag.
51     *
52     * @param id    the id from the GEDCOM line (might be <code>null</code>)
53     * @param tag   the tag from the GEDCOM line
54     * @param value the value from the GEDCOM line (might be <code>null</code>)
55     */
56    public void handleStartTag(int level, String id, String tag, String value);
57  
58    /**
59     * Callback to handle the end of a level named by a given tag.
60     *
61     * @param tag the name of ending level
62     */
63    public void handleEndTag(int level, String tag);
64  }
65