org.apache.jackrabbit.spi.commons.nodetype.compact
Class CompactNodeTypeDefReader

java.lang.Object
  extended by org.apache.jackrabbit.spi.commons.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 QNodeTypeDefinition objects that can then be used to register node types.

The EBNF 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-Za-z0-9:_]+
 


Constructor Summary
CompactNodeTypeDefReader(Reader r, String systemId, NamespaceMapping mapping, QNodeTypeDefinitionsBuilder builder)
          Creates a new CND reader.
CompactNodeTypeDefReader(Reader r, String systemId, QNodeTypeDefinitionsBuilder builder)
          Creates a new CND reader.
 
Method Summary
 NamespaceMapping getNamespaceMapping()
          Returns the namespace mapping.
 List getNodeTypeDefs()
          Returns the list of parsed QNodeTypeDefinition 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,
                                QNodeTypeDefinitionsBuilder builder)
                         throws ParseException
Creates a new CND reader.

Parameters:
r -
systemId -
builder -
Throws:
ParseException

CompactNodeTypeDefReader

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

Parameters:
r -
builder -
Throws:
ParseException
Method Detail

getNodeTypeDefs

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

Returns:
a List of QNodeTypeDefinition objects

getNamespaceMapping

public NamespaceMapping getNamespaceMapping()
Returns the namespace mapping.

Returns:
a NamespaceMapping object.


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