001: /**
002: * Copyright (c) 2003, www.pdfbox.org
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 are met:
007: *
008: * 1. Redistributions of source code must retain the above copyright notice,
009: * this list of conditions and the following disclaimer.
010: * 2. 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: * 3. Neither the name of pdfbox; nor the names of its
014: * contributors may be used to endorse or promote products derived from this
015: * software without specific prior written permission.
016: *
017: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
018: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
019: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
020: * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
021: * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
022: * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
023: * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
024: * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
025: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
026: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
027: *
028: * http://www.pdfbox.org
029: *
030: */package org.pdfbox.cos;
031:
032: import org.pdfbox.exceptions.COSVisitorException;
033:
034: /**
035: * An interface for visiting a PDF document at the type (COS) level.
036: *
037: * @author Michael Traut
038: * @version $Revision: 1.6 $
039: */
040: public interface ICOSVisitor {
041: /**
042: * Notification of visit to Array object.
043: *
044: * @param obj The Object that is being visited.
045: * @return any Object depending on the visitor implementation, or null
046: * @throws COSVisitorException If there is an error while visiting this object.
047: */
048: public Object visitFromArray(COSArray obj)
049: throws COSVisitorException;
050:
051: /**
052: * Notification of visit to boolean object.
053: *
054: * @param obj The Object that is being visited.
055: * @return any Object depending on the visitor implementation, or null
056: * @throws COSVisitorException If there is an error while visiting this object.
057: */
058: public Object visitFromBoolean(COSBoolean obj)
059: throws COSVisitorException;
060:
061: /**
062: * Notification of visit to dictionary object.
063: *
064: * @param obj The Object that is being visited.
065: * @return any Object depending on the visitor implementation, or null
066: * @throws COSVisitorException If there is an error while visiting this object.
067: */
068: public Object visitFromDictionary(COSDictionary obj)
069: throws COSVisitorException;
070:
071: /**
072: * Notification of visit to document object.
073: *
074: * @param obj The Object that is being visited.
075: * @return any Object depending on the visitor implementation, or null
076: * @throws COSVisitorException If there is an error while visiting this object.
077: */
078: public Object visitFromDocument(COSDocument obj)
079: throws COSVisitorException;
080:
081: /**
082: * Notification of visit to float object.
083: *
084: * @param obj The Object that is being visited.
085: * @return any Object depending on the visitor implementation, or null
086: * @throws COSVisitorException If there is an error while visiting this object.
087: */
088: public Object visitFromFloat(COSFloat obj)
089: throws COSVisitorException;
090:
091: /**
092: * Notification of visit to integer object.
093: *
094: * @param obj The Object that is being visited.
095: * @return any Object depending on the visitor implementation, or null
096: * @throws COSVisitorException If there is an error while visiting this object.
097: */
098: public Object visitFromInt(COSInteger obj)
099: throws COSVisitorException;
100:
101: /**
102: * Notification of visit to name object.
103: *
104: * @param obj The Object that is being visited.
105: * @return any Object depending on the visitor implementation, or null
106: * @throws COSVisitorException If there is an error while visiting this object.
107: */
108: public Object visitFromName(COSName obj) throws COSVisitorException;
109:
110: /**
111: * Notification of visit to null object.
112: *
113: * @param obj The Object that is being visited.
114: * @return any Object depending on the visitor implementation, or null
115: * @throws COSVisitorException If there is an error while visiting this object.
116: */
117: public Object visitFromNull(COSNull obj) throws COSVisitorException;
118:
119: /**
120: * Notification of visit to stream object.
121: *
122: * @param obj The Object that is being visited.
123: * @return any Object depending on the visitor implementation, or null
124: * @throws COSVisitorException If there is an error while visiting this object.
125: */
126: public Object visitFromStream(COSStream obj)
127: throws COSVisitorException;
128:
129: /**
130: * Notification of visit to string object.
131: *
132: * @param obj The Object that is being visited.
133: * @return any Object depending on the visitor implementation, or null
134: * @throws COSVisitorException If there is an error while visiting this object.
135: */
136: public Object visitFromString(COSString obj)
137: throws COSVisitorException;
138: }
|