Source Code Cross Referenced for Field.java in  » Database-ORM » MMBase » org » mmbase » bridge » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » MMBase » org.mmbase.bridge 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:        This software is OSI Certified Open Source Software.
004:        OSI Certified is a certification mark of the Open Source Initiative.
005:
006:        The license (Mozilla version 1.0) can be read at the MMBase site.
007:        See http://www.MMBase.org/license
008:
009:         */
010:
011:        package org.mmbase.bridge;
012:
013:        import org.mmbase.datatypes.DataType;
014:
015:        /**
016:         * This interface represents a node's field type information object.
017:         *
018:         * @author Pierre van Rooden
019:         * @author Jaco de Groot
020:         * @version $Id: Field.java,v 1.37 2007/02/10 15:47:42 nklasens Exp $
021:         */
022:        public interface Field extends Descriptor, Comparable<Field> {
023:
024:            /** MMBase base type identifier for the String data type */
025:            public final static int TYPE_STRING = 1;
026:            /** MMBase base type identifier for the Integer data type */
027:            public final static int TYPE_INTEGER = 2;
028:            /** MMBase base type identifier for the binary (byte[]) data type */
029:            public final static int TYPE_BINARY = 4;
030:            /**
031:             * MMBase base type identifier for the binary (byte[]) data type
032:             * @deprecated use {@link #TYPE_BINARY}
033:             */
034:            @Deprecated
035:            public final static int TYPE_BYTE = TYPE_BINARY;
036:            /** MMBase base type identifier for the Float data type */
037:            public final static int TYPE_FLOAT = 5;
038:            /** MMBase base type identifier for the Double data type */
039:            public final static int TYPE_DOUBLE = 6;
040:            /** MMBase base type identifier for the Long data type */
041:            public final static int TYPE_LONG = 7;
042:            /** MMBase base type identifier for the DOM Document data type */
043:            public final static int TYPE_XML = 8;
044:            /** MMBase base type identifier for the Node data type */
045:            public final static int TYPE_NODE = 9;
046:            /**
047:             * MMBase base type identifier for the Date data type
048:             * @since MMBase-1.8
049:             */
050:            public final static int TYPE_DATETIME = 10;
051:            /**
052:             * MMBase base type identifier for the Boolean data type
053:             * @since MMBase-1.8
054:             */
055:            public final static int TYPE_BOOLEAN = 11;
056:            /**
057:             * MMBase base type identifier for the List data type
058:             * @since MMBase-1.8
059:             */
060:            public final static int TYPE_LIST = 12;
061:            /** MMBase base type identifier for data types whose type is unknown */
062:            public final static int TYPE_UNKNOWN = -1;
063:
064:            /** A field's state is 'virtual' if it is not persistent in storage. */
065:            public final static int STATE_VIRTUAL = 0;
066:            /** A field's state is 'persistent' if it is persistent in storage, and editable. */
067:            public final static int STATE_PERSISTENT = 2;
068:            /** A field's state is 'system' if it is persistent in storage, but not editable by users. */
069:            public final static int STATE_SYSTEM = 3;
070:            /** A field's state is 'system virtual' if it is not persistent in storage, nor editable by users.
071:             *  @todo reserved but not used yet
072:             */
073:            public final static int STATE_SYSTEM_VIRTUAL = 4;
074:            /** The field's state when it is not (yet) known. */
075:            public final static int STATE_UNKNOWN = -1;
076:
077:            /**
078:             * Returns the node manager this field belongs to.
079:             *
080:             * @return  the node manager this field belongs to
081:             */
082:            public NodeManager getNodeManager();
083:
084:            /**
085:             * Returns this field's state identifier (virtual, persistent, system, systemvirtual).
086:             *
087:             * @return  an <code>int</code> which identifies the state of this field
088:             */
089:            public int getState();
090:
091:            /**
092:             * Returns the data type this field contains.
093:             *
094:             * @return  a <code>DataType</code>  object describing the constraints on this field.
095:             * @since MMBase-1.8
096:             */
097:            public DataType getDataType();
098:
099:            /**
100:             * Returns whether this field is part of a unique key (a set of fields whose combined content should
101:             * occur only once).
102:             * Note that MMBase lets the storage layer handle this. If your storage implementation or configuration does
103:             * not support this the uniqueness may not be enforced.
104:             *
105:             * @return  <code>true</code> if the field is part of a unique key
106:             * @since  MMBase-1.6
107:             */
108:            public boolean isUnique();
109:
110:            /**
111:             * Returns whether this field is a key field, meaning that the storage layer should define an index for it, allowing
112:             * optimization with search and sort actions.
113:             * Note that MMBase lets the storage layer decide whether an index is actually defined.
114:             * Some implementations or configurations may not do this.
115:             * Note: Currently, this method only returns true if the field is the primary key (number field) or a Node field.
116:             *
117:             * @return  <code>true</code> if the field has a key defined
118:             * @since  MMBase-1.7
119:             */
120:            public boolean hasIndex();
121:
122:            /**
123:             * Returns the identifier for the MMBase base type for this field.
124:             * This represents one of field type constants. This basic type determines how data is stored in MMBase.
125:             * Note that it is possible that the datatype for a field (used for validation and in/out put) can be of a different
126:             * basic type than how it is stored in the database. This shoudl not occur often, but is possible in some cases, such
127:             * as when you use older clod models (which used INTEGER fields for dates).
128:             * In general this should not prove a [problem - however you shoudl not assumeto know the classtype iof data of a
129:             * field based on this method.
130:             * To acquire the datatype's type, use <code>getDataType.getBaseType()</code> instead.
131:             * @return  an <code>int</code> which identifies the base type
132:             */
133:            public int getType();
134:
135:            /**
136:             * If the type of this field is TYPE_LIST, this method returns the MMBase base type for the list elements.
137:             * This represents one of field type constants. This basic type determines how data is stored in MMBase.
138:             * For any field types other that TYPE_LIST, this method returns TYPE_UNKNOWN.
139:             * @return  an <code>int</code> which identifies the base type
140:             */
141:            public int getListItemType();
142:
143:            /**
144:             * Retrieve the position of the field when searching.
145:             * A value of -1 indicates the field is unavailable during search.
146:             * @since MMBase-1.8
147:             */
148:            public int getSearchPosition();
149:
150:            /**
151:             * Retrieve the position of the field when listing.
152:             * A value of -1 indicates the field is unavailable in a list.
153:             * @since MMBase-1.8
154:             */
155:            public int getListPosition();
156:
157:            /**
158:             * Retrieve the position of the field when editing.
159:             * A value of -1 indicates the field cannot be edited.
160:             * @since MMBase-1.8
161:             */
162:            public int getEditPosition();
163:
164:            /**
165:             * Retrieve the position of the field in the database table.
166:             * @since MMBase-1.8
167:             */
168:            public int getStoragePosition();
169:
170:            /**
171:             * Returns the GUI name for the data type this field contains.
172:             * @deprecated use {@link #getDataType } and {@link DataType#getName}
173:             * @see #getDataType
174:             */
175:            @Deprecated
176:            public String getGUIType();
177:
178:            /**
179:             * Returns whether this field is required (should have content).
180:             * Note that MMBase does not generally enforce required fields to be filled -
181:             * If not provided, a default value (generally an empty string or the integer value -1)
182:             * is filled in by the system.
183:             * As such, isRequired will mostly be used as an indicator for (generic) editors.
184:             *
185:             * @return  <code>true</code> if the field is required
186:             * @since  MMBase-1.6
187:             */
188:            public boolean isRequired();
189:
190:            /**
191:             * Returns the maximum length of data this field can contain.
192:             * For example if a field contains characters the size indicates the
193:             * maximum number of characters it can contain.
194:             * If the field is a numeric field (such as an integer), the result is -1.
195:             *
196:             * @return  the maximum length of data this field can contain
197:             */
198:            public int getMaxLength();
199:
200:            /**
201:             * Checks whether a given value is valid for this field.
202:             * @return Collection of error-strings (describing the problem) in the current locale, or an empty collection if the value is ok.
203:             * @since MMBase-1.8
204:             */
205:            public java.util.Collection validate(Object value);
206:
207:            /**
208:             * A field's state is 'virtual' if it is not persistent in storage.
209:             * @return <code>true</code> when a field is virtual
210:             * @since MMBase-1.8
211:             */
212:            public boolean isVirtual();
213:
214:            /**
215:             * Returns whether a field is 'read only' - that is, a user cannot edit it.
216:             * In general, fields with state SYSTEM or SYSTEM_VIRTUAL are defined as read only, while others are not.
217:             * It is possible to override this behaviour per field.
218:             * @return <code>true</code> when a field is read only
219:             * @since MMBase-1.8
220:             */
221:            public boolean isReadOnly();
222:
223:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.