001/* 002 * Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved. 003 * 004 * This software is open source. 005 * See the bottom of this file for the licence. 006 * 007 * $Id: ProcessingInstruction.java,v 1.4 2001/01/24 16:52:13 jstrachan Exp $ 008 */ 009 010package org.dom4j; 011 012import java.util.Map; 013 014/** <p><code>ProcessingInstruction</code> defines an XML processing instruction. 015 * The {@link Node#getName} method will return the target of the PI and the 016 * {@link Node#getText} method will return the data from all of the instructions. 017 * </p> 018 * 019 * @author <a href="mailto:james.strachan@metastuff.com">James Strachan</a> 020 * @version $Revision: 1.4 $ 021 */ 022public interface ProcessingInstruction extends Node { 023 024 /** This method is the equivalent to the {@link #getName} 025 * method. It is added for clarity. 026 * 027 * @returns the target of this PI 028 */ 029 public String getTarget(); 030 031 /** This method is the equivalent to the {@link #setName} 032 * method. It is added for clarity. 033 */ 034 public void setTarget(String target); 035 036 /** @return the text for all the data associated with 037 * the processing instruction 038 */ 039 public String getText(); 040 041 /** <p>Returns the value of a specific name in the PI.</p> 042 * 043 * @param name is the name of the attribute to lookup. 044 * @return the value of the named attribute 045 */ 046 public String getValue(String name); 047 048 /** @return the values for this processing instruction as 049 * a Map 050 */ 051 public Map getValues(); 052 053 public void setValue(String name, String value); 054 public void setValues(Map data); 055 public boolean removeValue(String name); 056 057} 058 059 060 061 062 063 064/* 065 * Redistribution and use of this software and associated documentation 066 * ("Software"), with or without modification, are permitted provided 067 * that the following conditions are met: 068 * 069 * 1. Redistributions of source code must retain copyright 070 * statements and notices. Redistributions must also contain a 071 * copy of this document. 072 * 073 * 2. Redistributions in binary form must reproduce the 074 * above copyright notice, this list of conditions and the 075 * following disclaimer in the documentation and/or other 076 * materials provided with the distribution. 077 * 078 * 3. The name "DOM4J" must not be used to endorse or promote 079 * products derived from this Software without prior written 080 * permission of MetaStuff, Ltd. For written permission, 081 * please contact dom4j-info@metastuff.com. 082 * 083 * 4. Products derived from this Software may not be called "DOM4J" 084 * nor may "DOM4J" appear in their names without prior written 085 * permission of MetaStuff, Ltd. DOM4J is a registered 086 * trademark of MetaStuff, Ltd. 087 * 088 * 5. Due credit should be given to the DOM4J Project 089 * (http://dom4j.org/). 090 * 091 * THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS 092 * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT 093 * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 094 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 095 * METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 096 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 097 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 098 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 099 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 100 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 101 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 102 * OF THE POSSIBILITY OF SUCH DAMAGE. 103 * 104 * Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved. 105 * 106 * $Id: ProcessingInstruction.java,v 1.4 2001/01/24 16:52:13 jstrachan Exp $ 107 */