private void printPropertyDeclaration ( PropertyDefinitionData propertyDefinition , OutputStreamWriter out ) throws IOException , RepositoryException { /** Print name */ out . write ( "\r\n " ) ; out . write ( "- " + qNameToString ( propertyDefinition . getName ( ) ) ) ; out . write ( " (" + ExtendedPropertyType . nameFromValue ( propertyDefinition . getRequiredType ( ) ) . toUpperCase ( ) + ")" ) ; /** Print default values */ out . write ( listToString ( propertyDefinition . getDefaultValues ( ) , "'" , "\r\n = " , " " ) ) ; /** Print attributes */ StringBuilder attributes = new StringBuilder ( ) ; if ( propertyDefinition . isAutoCreated ( ) ) { attributes . append ( "autocreated " ) ; } if ( propertyDefinition . isMandatory ( ) ) { attributes . append ( "mandatory " ) ; } if ( propertyDefinition . isProtected ( ) ) { attributes . append ( "protected " ) ; } if ( propertyDefinition . isMultiple ( ) ) { attributes . append ( "multiple " ) ; } // if (!propertyDefinition.isFullTextSearchable()) // { // attributes += "nofulltext "; // } // if (!propertyDefinition.isQueryOrderable()) // { // attributes += "noqueryorder "; // } // /** Print operators avoiding printing all */ // String[] opArray = propertyDefinition.getAvailableQueryOperators(); // /** Using set to avoid duplication */ // Set<String> opSet = new HashSet<String>(); // for (String op : opArray) // { // opSet.add(op.toUpperCase()); // } // /** if not all elements are mentioned in list then print */ // if (opSet.size() < 7 && opSet.size() > 0) // { // String opString = opSet.toString(); // // opString="queryops '"+opString.substring(1, opString.length()-1)+"' "; // opString = listToString(opSet.toArray(new String[opSet.size()]), "", "\r\n queryops '", "' "); // attributes += opString; // } if ( propertyDefinition . getOnParentVersion ( ) != OnParentVersionAction . COPY ) { attributes . append ( "\r\n " + OnParentVersionAction . nameFromValue ( propertyDefinition . getOnParentVersion ( ) ) + " " ) ; } /** Don't print if all attributes are default */ if ( attributes . length ( ) > 0 ) { out . write ( "\r\n " ) ; out . write ( attributes . toString ( ) ) ; } out . write ( listToString ( propertyDefinition . getValueConstraints ( ) , "'" , "\r\n < " , " " ) ) ; }
Prints to output stream property definition in CND format