Class CompactNodeTypeDefReader<T,N>
- java.lang.Object
-
- org.apache.jackrabbit.commons.cnd.CompactNodeTypeDefReader<T,N>
-
- Type Parameters:
T
-N
-
public class CompactNodeTypeDefReader<T,N> extends Object
CompactNodeTypeDefReader. Parses node type definitions written in the compact node type definition format and provides a list of type definition objects that can then be used to register node types.The CompactNodeTypeDefReader is parameterizable in the type of the node type definition
T
and the type of the namespace mappingN
which the parser should build. For typesT
andN
the parser's constructor takes aDefinitionBuilderFactory
forT
andN
.The EBNF grammar of the compact node type definition:
Cnd ::= {NamespaceMapping | NodeTypeDef} NamespaceMapping ::= '<' Prefix '=' Uri '>' Prefix ::= String Uri ::= String NodeTypeDef ::= NodeTypeName [Supertypes] [NodeTypeAttribute {NodeTypeAttribute}] {PropertyDef | ChildNodeDef} NodeTypeName ::= '[' String ']' Supertypes ::= '>' (StringList | '?') NodeTypeAttribute ::= Orderable | Mixin | Abstract | Query | PrimaryItem Orderable ::= ('orderable' | 'ord' | 'o') ['?'] Mixin ::= ('mixin' | 'mix' | 'm') ['?'] Abstract ::= ('abstract' | 'abs' | 'a') ['?'] Query ::= ('noquery' | 'nq') | ('query' | 'q' ) PrimaryItem ::= ('primaryitem'| '!')(String | '?') PropertyDef ::= PropertyName [PropertyType] [DefaultValues] [PropertyAttribute {PropertyAttribute}] [ValueConstraints] PropertyName ::= '-' String PropertyType ::= '(' ('STRING' | 'BINARY' | 'LONG' | 'DOUBLE' | 'BOOLEAN' | 'DATE' | 'NAME' | 'PATH' | 'REFERENCE' | 'WEAKREFERENCE' | 'DECIMAL' | 'URI' | 'UNDEFINED' | '*' | '?') ')' DefaultValues ::= '=' (StringList | '?') ValueConstraints ::= '<' (StringList | '?') ChildNodeDef ::= NodeName [RequiredTypes] [DefaultType] [NodeAttribute {NodeAttribute}] NodeName ::= '+' String RequiredTypes ::= '(' (StringList | '?') ')' DefaultType ::= '=' (String | '?') PropertyAttribute ::= Autocreated | Mandatory | Protected | Opv | Multiple | QueryOps | NoFullText | NoQueryOrder NodeAttribute ::= Autocreated | Mandatory | Protected | Opv | Sns Autocreated ::= ('autocreated' | 'aut' | 'a' )['?'] Mandatory ::= ('mandatory' | 'man' | 'm') ['?'] Protected ::= ('protected' | 'pro' | 'p') ['?'] Opv ::= 'COPY' | 'VERSION' | 'INITIALIZE' | 'COMPUTE' | 'IGNORE' | 'ABORT' | ('OPV' '?') Multiple ::= ('multiple' | 'mul' | '*') ['?'] QueryOps ::= ('queryops' | 'qop') (('''Operator {','Operator}''') | '?') Operator ::= '=' | '<>' | '<' | '<=' | '>' | '>=' | 'LIKE' NoFullText ::= ('nofulltext' | 'nof') ['?'] NoQueryOrder ::= ('noqueryorder' | 'nqord') ['?'] Sns ::= ('sns' | '*') ['?'] StringList ::= String {',' String} String ::= QuotedString | UnquotedString QuotedString ::= SingleQuotedString | DoubleQuotedString SingleQuotedString ::= ''' UnquotedString ''' DoubleQuotedString ::= '"' UnquotedString '"' UnquotedString ::= XmlChar {XmlChar} XmlChar ::= see 3.2.2 Local Names
-
-
Constructor Summary
Constructors Constructor Description CompactNodeTypeDefReader(Reader r, String systemId, N nsMapping, DefinitionBuilderFactory<T,N> factory)
Creates a new CND reader and parses the given stream.CompactNodeTypeDefReader(Reader r, String systemId, DefinitionBuilderFactory<T,N> factory)
Creates a new CND reader and parses the given stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description N
getNamespaceMapping()
Returns the namespace mapping.List<T>
getNodeTypeDefinitions()
Returns the list of parsed node type definitions definitions.String
getSystemId()
Returns the previously assigned system id
-
-
-
Constructor Detail
-
CompactNodeTypeDefReader
public CompactNodeTypeDefReader(Reader r, String systemId, DefinitionBuilderFactory<T,N> factory) throws ParseException
Creates a new CND reader and parses the given stream.- Parameters:
r
- a reader to the CNDsystemId
- a informative id of the given streamfactory
- builder for creating new definitions and handling namespaces- Throws:
ParseException
- if an error occurs
-
CompactNodeTypeDefReader
public CompactNodeTypeDefReader(Reader r, String systemId, N nsMapping, DefinitionBuilderFactory<T,N> factory) throws ParseException
Creates a new CND reader and parses the given stream.- Parameters:
r
- a reader to the CNDsystemId
- a informative id of the given streamnsMapping
- default namespace mapping to usefactory
- builder for creating new definitions and handling namespaces- Throws:
ParseException
- if an error occurs
-
-
Method Detail
-
getSystemId
public String getSystemId()
Returns the previously assigned system id- Returns:
- the system id
-
getNodeTypeDefinitions
public List<T> getNodeTypeDefinitions()
Returns the list of parsed node type definitions definitions.- Returns:
- a collection of node type definition objects
-
getNamespaceMapping
public N getNamespaceMapping()
Returns the namespace mapping.- Returns:
-
-