Statistics
| Revision:

root / import / ext3D / trunk / install-extension3d / IzPack / src / lib / com / izforge / izpack / event / CompilerListener.java @ 15280

History | View | Annotate | Download (2.86 KB)

1
/*
2
 *  $Id: CompilerListener.java,v 1.1 2006/06/14 07:29:07 cesar Exp $
3
 *  IzPack
4
 *  Copyright (C) 2004 Klaus Bartz
5
 *
6
 *  File :               CompilerListener.java
7
 *  Description :        Custom action listener interface for compile time.
8
 *  Author's email :     klaus.bartz@coi.de
9
 *  Author's Website :   http://www.coi.de/
10
 *
11
 *  This program is free software; you can redistribute it and/or
12
 *  modify it under the terms of the GNU General Public License
13
 *  as published by the Free Software Foundation; either version 2
14
 *  of the License, or any later version.
15
 *
16
 *  This program is distributed in the hope that it will be useful,
17
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 *  GNU General Public License for more details.
20
 *
21
 *  You should have received a copy of the GNU General Public License
22
 *  along with this program; if not, write to the Free Software
23
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24
 */
25

    
26
package com.izforge.izpack.event;
27

    
28
import java.util.Map;
29

    
30
import com.izforge.izpack.compiler.CompilerException;
31
import com.izforge.izpack.compiler.Packager;
32

    
33
import net.n3.nanoxml.XMLElement;
34

    
35
/**
36
 * <p>Implementations of this class are used
37
 * to add extensions to the packs at compilation.</p>
38
 *
39
 * @author  Klaus Bartz
40
 *
41
 */
42
public interface CompilerListener
43
{
44
  public final static int BEGIN = 1;
45
  public final static int END   = 2;
46
  /**
47
   * This method is called from the compiler for each file (or dir)
48
   * parsing. The XMLElement is a node of the file related children
49
   * of the XML element "pack" (see installation.dtd). Current
50
   * these are "file", "singlefile" or "fileset".
51
   * If an additional data should be set, it should be added
52
   * to the given data map (if exist). If no map exist a new
53
   * should be created and filled. The data map will be added
54
   * to the PackFile object after all registered CompilerListener are
55
   * called.
56
   * If the map contains an not common object, it is necessary
57
   * to add the needed class to the installer. 
58
   * @param existentDataMap attribute set with previos setted attributes
59
   * @param element current file related XML node
60
   * @return the given or a new attribute set. If no attribute set is given
61
   * and no attribute was added, null returns
62
   * @throws CompilerException
63
   */
64
  Map reviseAdditionalDataMap( 
65
    Map existentDataMap, XMLElement element )
66
    throws CompilerException;
67

    
68
  /**
69
   * This method will be called from each step of packaging.
70
   * @param position name of the calling method, e.g. "addVariables"
71
   * @param state BEGIN or END
72
   * @param data  current install data
73
   * @param packager current packager object
74
   */
75
  void notify(String position, int state, XMLElement data, Packager packager);
76
  
77
}