001: /*
002: * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: *
023: * Free Software Foundation, Inc.
024: * 59 Temple Place, Suite 330
025: * Boston, MA 02111-1307 USA
026: *
027: * @author Scott Ferguson
028: */
029: package javax.jcr;
030:
031: import javax.jcr.lock.LockException;
032: import javax.jcr.nodetype.ConstraintViolationException;
033: import javax.jcr.nodetype.PropertyDefinition;
034: import javax.jcr.version.VersionException;
035: import java.io.InputStream;
036: import java.util.Calendar;
037:
038: /**
039: * Represents a node's property.
040: */
041: public interface Property extends Item {
042: /**
043: * Sets the property value.
044: */
045: public void setValue(Value value) throws ValueFormatException,
046: VersionException, LockException,
047: ConstraintViolationException, RepositoryException;
048:
049: /**
050: * Sets the property value to a value array.
051: */
052: public void setValue(Value[] values) throws ValueFormatException,
053: VersionException, LockException,
054: ConstraintViolationException, RepositoryException;
055:
056: /**
057: * Sets the property value to a string.
058: */
059: public void setValue(String value) throws ValueFormatException,
060: VersionException, LockException,
061: ConstraintViolationException, RepositoryException;
062:
063: /**
064: * Sets the property value to a string array.
065: */
066: public void setValue(String[] values) throws ValueFormatException,
067: VersionException, LockException,
068: ConstraintViolationException, RepositoryException;
069:
070: /**
071: * Sets the property value to a binary chunk.
072: */
073: public void setValue(InputStream value)
074: throws ValueFormatException, VersionException,
075: LockException, ConstraintViolationException,
076: RepositoryException;
077:
078: /**
079: * Sets the property value to a long.
080: */
081: public void setValue(long value) throws ValueFormatException,
082: VersionException, LockException,
083: ConstraintViolationException, RepositoryException;
084:
085: /**
086: * Sets the property value to a double.
087: */
088: public void setValue(double value) throws ValueFormatException,
089: VersionException, LockException,
090: ConstraintViolationException, RepositoryException;
091:
092: /**
093: * Sets the property value to a date.
094: */
095: public void setValue(Calendar value) throws ValueFormatException,
096: VersionException, LockException,
097: ConstraintViolationException, RepositoryException;
098:
099: /**
100: * Sets the property value to a boolean.
101: */
102: public void setValue(boolean value) throws ValueFormatException,
103: VersionException, LockException,
104: ConstraintViolationException, RepositoryException;
105:
106: /**
107: * Sets the property value to a node reference.
108: */
109: public void setValue(Node value) throws ValueFormatException,
110: VersionException, LockException,
111: ConstraintViolationException, RepositoryException;
112:
113: /**
114: * Returns the property value.
115: */
116: public Value getValue() throws ValueFormatException,
117: RepositoryException;
118:
119: /**
120: * Returns the property value as a value array.
121: */
122: public Value[] getValues() throws ValueFormatException,
123: RepositoryException;
124:
125: /**
126: * Returns the property value as a string.
127: */
128: public String getString() throws ValueFormatException,
129: RepositoryException;
130:
131: /**
132: * Returns the property value as a binary stream.
133: */
134: public InputStream getStream() throws ValueFormatException,
135: RepositoryException;
136:
137: /**
138: * Returns the property value as a long.
139: */
140: public long getLong() throws ValueFormatException,
141: RepositoryException;
142:
143: /**
144: * Returns the property value as a double.
145: */
146: public double getDouble() throws ValueFormatException,
147: RepositoryException;
148:
149: /**
150: * Returns the property value as a date.
151: */
152: public Calendar getDate() throws ValueFormatException,
153: RepositoryException;
154:
155: /**
156: * Returns the property value as a boolean.
157: */
158: public boolean getBoolean() throws ValueFormatException,
159: RepositoryException;
160:
161: /**
162: * Returns the property value as a node reference.
163: */
164: public Node getNode() throws ValueFormatException,
165: RepositoryException;
166:
167: /**
168: * Returns the size of the property.
169: */
170: public long getLength() throws ValueFormatException,
171: RepositoryException;
172:
173: /**
174: * Returns the size of all the properties.
175: */
176: public long[] getLengths() throws ValueFormatException,
177: RepositoryException;
178:
179: /**
180: * Returns the property's definition.
181: */
182: public PropertyDefinition getDefinition()
183: throws RepositoryException;
184:
185: /**
186: * Returns the property's base type.
187: */
188: public int getType() throws RepositoryException;
189: }
|