public class JahiaCndReaderLegacy extends Object
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:_]+
| Modifier and Type | Field and Description |
|---|---|
protected String |
currentToken
the current token
|
protected String |
filename |
protected LexerLegacy |
lexer
the underlying LexerLegacy
|
protected List<ExtendedNodeType> |
nodeTypesList
the list of parsed nodetype defs
|
protected NodeTypeRegistry |
registry
the registry where the types should be stored
|
protected String |
systemId |
| Constructor and Description |
|---|
JahiaCndReaderLegacy(Reader r,
String filename,
String systemId,
NodeTypeRegistry registry)
Creates a new CND reader.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
currentTokenEquals(char c)
Checks if the
currentToken is semantically equal to the given
argument. |
protected boolean |
currentTokenEquals(String s)
Checks if the
currentToken is semantically equal to the given
argument. |
protected boolean |
currentTokenEquals(String[] s)
Checks if the
currentToken is semantically equal to the given
argument. |
List<ExtendedNodeType> |
getNodeTypesList()
Returns the list of parsed nodetype definitions.
|
protected void |
nextToken()
Gets the next token from the underlying LexerLegacy.
|
void |
parse()
Parses the definition
|
protected Name |
parseName(String name) |
protected String systemId
protected String filename
protected NodeTypeRegistry registry
protected List<ExtendedNodeType> nodeTypesList
protected LexerLegacy lexer
protected String currentToken
public JahiaCndReaderLegacy(Reader r, String filename, String systemId, NodeTypeRegistry registry) throws ParseException, IOException
r - ParseExceptionIOExceptionpublic List<ExtendedNodeType> getNodeTypesList()
public void parse()
throws ParseException,
IOException,
javax.jcr.RepositoryException
ParseExceptionIOExceptionjavax.jcr.RepositoryExceptionprotected void nextToken()
throws ParseException
ParseException - if the LexerLegacy fails to get the next token.LexerLegacy.getNextToken()protected boolean currentTokenEquals(String[] s)
currentToken is semantically equal to the given
argument.s - the tokens to compare withtrue if equals; false otherwise.protected boolean currentTokenEquals(char c)
currentToken is semantically equal to the given
argument.c - the tokens to compare withtrue if equals; false otherwise.protected boolean currentTokenEquals(String s)
currentToken is semantically equal to the given
argument.s - the tokens to compare withtrue if equals; false otherwise.protected Name parseName(String name) throws ParseException
ParseExceptionCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.