jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r763244 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact: CompactNodeTypeDefReader.java Lexer.java
Date Wed, 08 Apr 2009 13:45:10 GMT
Author: tripod
Date: Wed Apr  8 13:45:10 2009
New Revision: 763244

URL: http://svn.apache.org/viewvc?rev=763244&view=rev
Log:
JCR-2064 Add new JSR283 features to CND reader/writer (work in progress)

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/Lexer.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java?rev=763244&r1=763243&r2=763244&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
Wed Apr  8 13:45:10 2009
@@ -316,19 +316,26 @@
      * @throws ParseException
      */
     private void doOptions(NodeTypeDef ntd) throws ParseException {
-        if (currentTokenEquals(Lexer.ORDERABLE)) {
-            ntd.setOrderableChildNodes(true);
-            nextToken();
-            if (currentTokenEquals(Lexer.MIXIN)) {
-                ntd.setMixin(true);
-                nextToken();
-            }
-        } else if (currentTokenEquals(Lexer.MIXIN)) {
-            ntd.setMixin(true);
-            nextToken();
+        boolean hasOption = true;
+        while (hasOption) {
             if (currentTokenEquals(Lexer.ORDERABLE)) {
+                nextToken();
                 ntd.setOrderableChildNodes(true);
+            } else if (currentTokenEquals(Lexer.MIXIN)) {
+                nextToken();
+                ntd.setMixin(true);
+            } else if (currentTokenEquals(Lexer.ABSTRACT)) {
+                nextToken();
+                ntd.setAbstract(true);
+            } else if (currentTokenEquals(Lexer.NOQUERY)) {
+                nextToken();
+                // ntd.setNoQuery(true);
+            } else if (currentTokenEquals(Lexer.PRIMARYITEM)) {
+                nextToken();
+                ntd.setPrimaryItemName(toQName(currentToken));
                 nextToken();
+            } else {
+                hasOption = false;
             }
         }
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/Lexer.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/Lexer.java?rev=763244&r1=763243&r2=763244&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/Lexer.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/Lexer.java
Wed Apr  8 13:45:10 2009
@@ -39,6 +39,9 @@
 
     public static final String[] ORDERABLE = new String[] {"orderable", "ord", "o"};
     public static final String[] MIXIN = new String[]{"mixin", "mix", "m"};
+    public static final String[] ABSTRACT = new String[]{"abstract", "abs", "a"};
+    public static final String[] NOQUERY = new String[]{"noquery", "nq"};
+    public static final String[] PRIMARYITEM = new String[]{"primaryitem", "!"};
 
     public static final String[] PRIMARY = new String[]{"primary", "pri", "!"};
     public static final String[] AUTOCREATED = new String[]{"autocreated", "aut", "a"};



Mime
View raw message