public static Object generateExample ( Property property , MarkupDocBuilder markupDocBuilder ) { if ( property . getType ( ) == null ) { return "untyped" ; } switch ( property . getType ( ) ) { case "integer" : return ExamplesUtil . generateIntegerExample ( property instanceof IntegerProperty ? ( ( IntegerProperty ) property ) . getEnum ( ) : null ) ; case "number" : return 0.0 ; case "boolean" : return true ; case "string" : return ExamplesUtil . generateStringExample ( property . getFormat ( ) , property instanceof StringProperty ? ( ( StringProperty ) property ) . getEnum ( ) : null ) ; case "ref" : if ( property instanceof RefProperty ) { if ( logger . isDebugEnabled ( ) ) logger . debug ( "generateExample RefProperty for " + property . getName ( ) ) ; return markupDocBuilder . copy ( false ) . crossReference ( ( ( RefProperty ) property ) . getSimpleRef ( ) ) . toString ( ) ; } else { if ( logger . isDebugEnabled ( ) ) logger . debug ( "generateExample for ref not RefProperty" ) ; } case "array" : if ( property instanceof ArrayProperty ) { return generateArrayExample ( ( ArrayProperty ) property , markupDocBuilder ) ; } default : return property . getType ( ) ; } }
Generate a default example value for property .