org.apache.jackrabbit.core.nodetype.compact
Class CompactNodeTypeDefReader

java.lang.Object
  extended byorg.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefReader

public class CompactNodeTypeDefReader
extends Object

CompactNodeTypeDefReader. Parses node type definitions written in the compact node type definition format and returns a list of NodeTypeDef objects that can then be used to register node types.

The BNF grammar of the compact node type definition:

 cnd ::= {ns_mapping | node_type_def}

 ns_mapping ::= "<" prefix "=" namespace ">"

 prefix ::= string

 namespace ::= string

 node_type_def ::= node_type_name [super_types] [options] {property_def | node_def}

 node_type_name ::= "[" string "]"

 super_types ::= ">" string_list

 options ::= orderable_opt | mixin_opt | orderable_opt mixin_opt | mixin_opt orderable_opt

 orderable_opt ::= "orderable" | "ord" | "o"

 mixin_opt ::= "mixin" | "mix" | "m"

 property_def ::= "-" property_name [property_type_decl] [default_values] [attributes] [value_constraints]

 property_name ::= string

 property_type_decl ::= "(" property_type ")"

 property_type ::= "STRING" | "String |"string" |
                   "BINARY" | "Binary" | "binary" |
                   "LONG" | "Long" | "long" |
                   "DOUBLE" | "Double" | "double" |
                   "BOOLEAN" | "Boolean" | "boolean" |
                   "DATE" | "Date" | "date" |
                   "NAME | "Name | "name |
                   "PATH" | "Path" | "path" |
                   "REFERENCE" | "Reference" | "reference" |
                   "UNDEFINED" | "Undefined" | "undefined" | "*"


 default_values ::= "=" string_list

 value_constraints ::= "<" string_list

 node_def ::= "+" node_name [required_types] [default_type] [attributes]

 node_name ::= string

 required_types ::= "(" string_list ")"

 default_type ::= "=" string

 attributes ::= "primary" | "pri" | "!" |
                "autocreated" | "aut" | "a" |
                "mandatory" | "man" | "m" |
                "protected" | "pro" | "p" |
                "multiple" | "mul" | "*" |
                "COPY" | "Copy" | "copy" |
                "VERSION" | "Version" | "version" |
                "INITIALIZE" | "Initialize" | "initialize" |
                "COMPUTE" | "Compute" | "compute" |
                "IGNORE" | "Ignore" | "ignore" |
                "ABORT" | "Abort" | "abort"

 string_list ::= string {"," string}

 string ::= quoted_string | unquoted_string

 quoted_string :: = "'" unquoted_string "'"

 unquoted_string ::= ...a string...
 


Constructor Summary
CompactNodeTypeDefReader(Reader r, String systemId)
          Creates a new CND reader.
CompactNodeTypeDefReader(Reader r, String systemId, NamespaceMapping mapping)
          Creates a new CND reader.
 
Method Summary
 NamespaceMapping getNamespaceMapping()
          Returns the namespace mapping.
 List getNodeTypeDefs()
          Returns the list of parsed nodetype definitions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompactNodeTypeDefReader

public CompactNodeTypeDefReader(Reader r,
                                String systemId)
                         throws ParseException
Creates a new CND reader.

Parameters:
r -
Throws:
ParseException

CompactNodeTypeDefReader

public CompactNodeTypeDefReader(Reader r,
                                String systemId,
                                NamespaceMapping mapping)
                         throws ParseException
Creates a new CND reader.

Parameters:
r -
Throws:
ParseException
Method Detail

getNodeTypeDefs

public List getNodeTypeDefs()
Returns the list of parsed nodetype definitions.

Returns:
a List of NodeTypeDef objects

getNamespaceMapping

public NamespaceMapping getNamespaceMapping()
Returns the namespace mapping.

Returns:
a NamespaceMapping object.


Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.