001: /*
002: * Copyright (c) 2001-2007, Jean Tessier
003: * All rights reserved.
004: *
005: * Redistribution and use in source and binary forms, with or without
006: * modification, are permitted provided that the following conditions
007: * are met:
008: *
009: * * Redistributions of source code must retain the above copyright
010: * notice, this list of conditions and the following disclaimer.
011: *
012: * * Redistributions in binary form must reproduce the above copyright
013: * notice, this list of conditions and the following disclaimer in the
014: * documentation and/or other materials provided with the distribution.
015: *
016: * * Neither the name of Jean Tessier nor the names of his contributors
017: * may be used to endorse or promote products derived from this software
018: * without specific prior written permission.
019: *
020: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
021: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
022: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
023: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
024: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
025: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
026: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
027: * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
028: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
029: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
030: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
031: */
032:
033: package com.jeantessier.classreader;
034:
035: import java.util.*;
036:
037: public interface LoadListener extends EventListener {
038: public void beginSession(LoadEvent event);
039:
040: /**
041: * <p>The loader is starting on a new group of files.
042: * For example, this can be a new JAR file or a
043: * collection of loose <code>.class</code> files.</p>
044: *
045: * <p>The event's filename attribute points to the source
046: * or the group of files, such as the JAR file's name
047: * or the root directory of the loose files.</p>
048: *
049: * <p>The element and classfile attributes are null.</p>
050: */
051: public void beginGroup(LoadEvent event);
052:
053: /**
054: * <p>The loader is starting on a new file.</p>
055: *
056: * <p>The event's element attribute contains the name of
057: * the file being processed.</p>
058: *
059: * <p>The event's filename attribute points to the group
060: * of files that contains the current file. For
061: * example, the JAR file's name or the root directory
062: * of loose files.</p>
063: *
064: * <p>The classfile attribute is null.</p>
065: */
066: public void beginFile(LoadEvent event);
067:
068: /**
069: * <p>The loader is starting on a new <code>.class</code>
070: * file.</p>
071: *
072: * <p>The event's element attribute contains the name of
073: * the <code>.class</code> file being processed.</p>
074: *
075: * <p>The event's filename attribute points to the group
076: * of files that contains the current file. For
077: * example, the JAR file's name or the root directory
078: * of loose files.</p>
079: *
080: * <p>The classfile attribute is null.</p>
081: */
082: public void beginClassfile(LoadEvent event);
083:
084: /**
085: * <p>The loader is finished loading a <code>.class</code>
086: * file.</p>
087: *
088: * <p>The event's classfile attribute contains the newly
089: * loaded Classfile instance from the <code>.class</code>
090: * file.</p>
091: *
092: * <p>The event's filename attribute points to the group
093: * of files that contains the current file. For
094: * example, the JAR file's name or the root directory
095: * of loose files.</p>
096: *
097: * <p>The element attribute is null.</p>
098: */
099: public void endClassfile(LoadEvent event);
100:
101: /**
102: * <p>The loader is finished with a file.</p>
103: *
104: * <p>The event's element attribute contains the name of
105: * the file being processed.</p>
106: *
107: * <p>The event's filename attribute points to the group
108: * of files that contains the current file. For
109: * example, the JAR file's name or the root directory
110: * of loose files.</p>
111: *
112: * <p>The event's classfile attribute may contains a newly
113: * loaded Classfile instance from the file.</p>
114: */
115: public void endFile(LoadEvent event);
116:
117: /**
118: * <p>The loader finished the group of files. For
119: * example, this can be a new JAR file or a
120: * collection of loose <code>.class</code> files.</p>
121: *
122: * <p>The event's filename attribute points to the source
123: * or the group of files, such as the JAR file's name
124: * or the root directory of the loose files.</p>
125: *
126: * <p>The element and classfile attributes are null.</p>
127: */
128: public void endGroup(LoadEvent event);
129:
130: public void endSession(LoadEvent event);
131: }
|