protected void parsePropertyAttributes ( TokenStream tokens , JcrPropertyDefinitionTemplate propDefn , JcrNodeTypeTemplate nodeType ) throws ConstraintViolationException { boolean autoCreated = false ; boolean mandatory = false ; boolean isProtected = false ; boolean multiple = false ; boolean isFullTextSearchable = true ; boolean isQueryOrderable = true ; String onParentVersion = "COPY" ; while ( true ) { if ( tokens . canConsumeAnyOf ( "AUTOCREATED" , "AUT" , "A" ) ) { tokens . canConsume ( ' ' ) ; autoCreated = true ; } else if ( tokens . canConsumeAnyOf ( "MANDATORY" , "MAN" , "M" ) ) { tokens . canConsume ( ' ' ) ; mandatory = true ; } else if ( tokens . canConsumeAnyOf ( "PROTECTED" , "PRO" , "P" ) ) { tokens . canConsume ( ' ' ) ; isProtected = true ; } else if ( tokens . canConsumeAnyOf ( "MULTIPLE" , "MUL" , "*" ) ) { tokens . canConsume ( ' ' ) ; multiple = true ; } else if ( tokens . matchesAnyOf ( VALID_ON_PARENT_VERSION ) ) { onParentVersion = tokens . consume ( ) ; tokens . canConsume ( ' ' ) ; } else if ( tokens . matches ( "OPV" ) ) { // variant on-parent-version onParentVersion = tokens . consume ( ) ; tokens . canConsume ( ' ' ) ; } else if ( tokens . canConsumeAnyOf ( "NOFULLTEXT" , "NOF" ) ) { tokens . canConsume ( ' ' ) ; isFullTextSearchable = false ; } else if ( tokens . canConsumeAnyOf ( "NOQUERYORDER" , "NQORD" ) ) { tokens . canConsume ( ' ' ) ; isQueryOrderable = false ; } else if ( tokens . canConsumeAnyOf ( "QUERYOPS" , "QOP" ) ) { parseQueryOperators ( tokens , propDefn ) ; } else if ( tokens . canConsumeAnyOf ( "PRIMARYITEM" , "PRIMARY" , "PRI" , "!" ) ) { Position pos = tokens . previousPosition ( ) ; int line = pos . getLine ( ) ; int column = pos . getColumn ( ) ; throw new ParsingException ( tokens . previousPosition ( ) , CndI18n . primaryKeywordNotValidInJcr2CndFormat . text ( line , column ) ) ; } else if ( tokens . matches ( CndTokenizer . VENDOR_EXTENSION ) ) { List < Property > properties = new LinkedList < Property > ( ) ; parseVendorExtensions ( tokens , properties ) ; applyVendorExtensions ( propDefn , properties ) ; } else { break ; } } propDefn . setAutoCreated ( autoCreated ) ; propDefn . setMandatory ( mandatory ) ; propDefn . setProtected ( isProtected ) ; propDefn . setOnParentVersion ( OnParentVersionAction . valueFromName ( onParentVersion . toUpperCase ( Locale . ROOT ) ) ) ; propDefn . setMultiple ( multiple ) ; propDefn . setFullTextSearchable ( isFullTextSearchable ) ; propDefn . setQueryOrderable ( isQueryOrderable ) ; }
Parse the property definition s attributes if they appear next on the token stream .