001: /*
002: * Copyright (c) 2007, intarsys consulting GmbH
003: *
004: * Redistribution and use in source and binary forms, with or without
005: * modification, are permitted provided that the following conditions are met:
006: *
007: * - Redistributions of source code must retain the above copyright notice,
008: * this list of conditions and the following disclaimer.
009: *
010: * - Redistributions in binary form must reproduce the above copyright notice,
011: * this list of conditions and the following disclaimer in the documentation
012: * and/or other materials provided with the distribution.
013: *
014: * - Neither the name of intarsys nor the names of its contributors may be used
015: * to endorse or promote products derived from this software without specific
016: * prior written permission.
017: *
018: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
019: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
020: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
021: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
022: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
023: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
024: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
025: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
026: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
027: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
028: * POSSIBILITY OF SUCH DAMAGE.
029: */
030: package de.intarsys.pdf.cos;
031:
032: /**
033: * An interface for visiting a COS object structure.
034: */
035: public interface ICOSObjectVisitor {
036: /**
037: * Notification of visit to {@link COSArray} object.
038: *
039: * @param array
040: * The Object that is being visited.
041: *
042: * @return any Object depending on the visitor implementation, or null
043: *
044: * @throws COSVisitorException
045: * If there is an error while visiting this object.
046: */
047: public Object visitFromArray(COSArray array)
048: throws COSVisitorException;
049:
050: /**
051: * Notification of visit to {@link COSBoolean} object.
052: *
053: * @param bool
054: * The Object that is being visited.
055: *
056: * @return any Object depending on the visitor implementation, or null
057: *
058: * @throws COSVisitorException
059: * If there is an error while visiting this object.
060: */
061: public Object visitFromBoolean(COSBoolean bool)
062: throws COSVisitorException;
063:
064: /**
065: * Notification of visit to {@link COSDictionary} object.
066: *
067: * @param dict
068: * The Object that is being visited.
069: *
070: * @return any Object depending on the visitor implementation, or null
071: *
072: * @throws COSVisitorException
073: * If there is an error while visiting this object.
074: */
075: public Object visitFromDictionary(COSDictionary dict)
076: throws COSVisitorException;
077:
078: /**
079: * Notification of visit to {@link COSFixed} object.
080: *
081: * @param fixed
082: * The Object that is being visited.
083: *
084: * @return any Object depending on the visitor implementation, or null
085: *
086: * @throws COSVisitorException
087: * If there is an error while visiting this object.
088: */
089: public Object visitFromFixed(COSFixed fixed)
090: throws COSVisitorException;
091:
092: /**
093: * Notification of visit to {@link COSInteger} object.
094: *
095: * @param integer
096: * The Object that is being visited.
097: *
098: * @return any Object depending on the visitor implementation, or null
099: *
100: * @throws COSVisitorException
101: * If there is an error while visiting this object.
102: */
103: public Object visitFromInteger(COSInteger integer)
104: throws COSVisitorException;
105:
106: /**
107: * Notification of visit to {@link COSName} object.
108: *
109: * @param name
110: * The Object that is being visited.
111: *
112: * @return any Object depending on the visitor implementation, or null
113: *
114: * @throws COSVisitorException
115: * If there is an error while visiting this object.
116: */
117: public Object visitFromName(COSName name)
118: throws COSVisitorException;
119:
120: /**
121: * Notification of visit to {@link COSNull} object.
122: *
123: * @param nullObj
124: * The Object that is being visited.
125: *
126: * @return any Object depending on the visitor implementation, or null
127: *
128: * @throws COSVisitorException
129: * If there is an error while visiting this object.
130: */
131: public Object visitFromNull(COSNull nullObj)
132: throws COSVisitorException;
133:
134: /**
135: * Notification of visit to {@link COSStream} object.
136: *
137: * @param stream
138: * The Object that is being visited.
139: *
140: * @return any Object depending on the visitor implementation, or null
141: *
142: * @throws COSVisitorException
143: * If there is an error while visiting this object.
144: */
145: public Object visitFromStream(COSStream stream)
146: throws COSVisitorException;
147:
148: /**
149: * Notification of visit to {@link COSString} object.
150: *
151: * @param string
152: * The Object that is being visited.
153: *
154: * @return any Object depending on the visitor implementation, or null
155: *
156: * @throws COSVisitorException
157: * If there is an error while visiting this object.
158: */
159: public Object visitFromString(COSString string)
160: throws COSVisitorException;
161:
162: /**
163: * Notification of visit to {@link COSIndirectObject} object.
164: *
165: * @param indirect
166: * The Object that is being visited.
167: *
168: * @return any Object depending on the visitor implementation, or null
169: *
170: * @throws COSVisitorException
171: * If there is an error while visiting this object.
172: */
173: public Object visitFromIndirectObject(COSIndirectObject indirect)
174: throws COSVisitorException;
175: }
|