Source Code Cross Referenced for OnParentVersionAction.java in  » 6.0-JDK-Modules » jsr-283 » javax » jcr » version » 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 » 6.0 JDK Modules » jsr 283 » javax.jcr.version 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2006 Day Management AG, Switzerland. All rights reserved.
003:         */
004:        package javax.jcr.version;
005:
006:        /**
007:         * The possible actions specified by the <code>onParentVersion</code> attribute
008:         * in a property definition within a node type definition.
009:         * <p>
010:         * This interface defines the following actions:
011:         * <UL>
012:         *    <LI><code>COPY</code>
013:         *    <LI><code>VERSION</code>
014:         *    <LI><code>INITIALIZE</code>
015:         *    <LI><code>COMPUTE</code>
016:         *    <LI><code>IGNORE</code>
017:         *    <LI><code>ABORT</code>
018:         * </UL>
019:         * <p>
020:         * Every item (node or property) in the repository has a status indicator that
021:         * governs what happens to that item when its parent node is versioned. This
022:         * status is defined by the <code>onParentVersion</code> attribute in
023:         * the <code>PropertyDefinition</code> or <code>NodeDefinition</code> that applies to the
024:         * item in question.
025:         *
026:         */
027:        public final class OnParentVersionAction {
028:
029:            /**
030:             * The action constants.
031:             */
032:            public static final int COPY = 1;
033:            public static final int VERSION = 2;
034:            public static final int INITIALIZE = 3;
035:            public static final int COMPUTE = 4;
036:            public static final int IGNORE = 5;
037:            public static final int ABORT = 6;
038:
039:            /**
040:             * The names of the defined on-version actions,
041:             * as used in serialization.
042:             */
043:            public static final String ACTIONNAME_COPY = "COPY";
044:            public static final String ACTIONNAME_VERSION = "VERSION";
045:            public static final String ACTIONNAME_INITIALIZE = "INITIALIZE";
046:            public static final String ACTIONNAME_COMPUTE = "COMPUTE";
047:            public static final String ACTIONNAME_IGNORE = "IGNORE";
048:            public static final String ACTIONNAME_ABORT = "ABORT";
049:
050:            /**
051:             * Returns the name of the specified <code>action</code>,
052:             * as used in serialization.
053:             * @param action the on-version action
054:             * @return the name of the specified <code>action</code>
055:             * @throws IllegalArgumentException if <code>action</code>
056:             * is not a valid on-version action.
057:             */
058:            public static String nameFromValue(int action) {
059:                switch (action) {
060:                case COPY:
061:                    return ACTIONNAME_COPY;
062:                case VERSION:
063:                    return ACTIONNAME_VERSION;
064:                case INITIALIZE:
065:                    return ACTIONNAME_INITIALIZE;
066:                case COMPUTE:
067:                    return ACTIONNAME_COMPUTE;
068:                case IGNORE:
069:                    return ACTIONNAME_IGNORE;
070:                case ABORT:
071:                    return ACTIONNAME_ABORT;
072:                default:
073:                    throw new IllegalArgumentException(
074:                            "unknown on-version action: " + action);
075:                }
076:            }
077:
078:            /**
079:             * Returns the numeric constant value of the on-version action with the
080:             * specified name.
081:             * @param name the name of the on-version action
082:             * @return the numeric constant value
083:             * @throws IllegalArgumentException if <code>name</code>
084:             * is not a valid on-version action name.
085:             */
086:            public static int valueFromName(String name) {
087:                if (name.equals(ACTIONNAME_COPY)) {
088:                    return COPY;
089:                } else if (name.equals(ACTIONNAME_VERSION)) {
090:                    return VERSION;
091:                } else if (name.equals(ACTIONNAME_INITIALIZE)) {
092:                    return INITIALIZE;
093:                } else if (name.equals(ACTIONNAME_COMPUTE)) {
094:                    return COMPUTE;
095:                } else if (name.equals(ACTIONNAME_IGNORE)) {
096:                    return IGNORE;
097:                } else if (name.equals(ACTIONNAME_ABORT)) {
098:                    return ABORT;
099:                } else {
100:                    throw new IllegalArgumentException(
101:                            "unknown on-version action: " + name);
102:                }
103:            }
104:
105:            /** private constructor to prevent instantiation */
106:            private OnParentVersionAction() {
107:            }
108:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.