public static Object generateExampleForRefModel(boolean generateMissingExamples,String simpleRef,Map<String,Model> definitions,MarkupDocBuilder markupDocBuilder,Map<String,Integer> refStack){
  Model model=definitions.get(simpleRef);
  Object example=null;
  if (model != null) {
    example=model.getExample();
    if (example == null && generateMissingExamples) {
      if (!refStack.containsKey(simpleRef)) {
        refStack.put(simpleRef,1);
      }
 else {
        refStack.put(simpleRef,refStack.get(simpleRef) + 1);
      }
      if (refStack.get(simpleRef) <= MAX_RECURSION_TO_DISPLAY) {
        if (model instanceof ComposedModel) {
          example=exampleMapForProperties(getPropertiesForComposedModel((ComposedModel)model,definitions),definitions,markupDocBuilder,refStack);
        }
 else {
          example=exampleMapForProperties(model.getProperties(),definitions,markupDocBuilder,refStack);
        }
      }
 else {
        return "...";
      }
      refStack.put(simpleRef,refStack.get(simpleRef) - 1);
    }
  }
  return example;
}

public static Object generateExampleForRefModel ( boolean generateMissingExamples , String simpleRef , Map < String , Model > definitions , MarkupDocBuilder markupDocBuilder , Map < String , Integer > refStack ) { Model model = definitions . get ( simpleRef ) ; Object example = null ; if ( model != null ) { example = model . getExample ( ) ; if ( example == null && generateMissingExamples ) { if ( ! refStack . containsKey ( simpleRef ) ) { refStack . put ( simpleRef , 1 ) ; } else { refStack . put ( simpleRef , refStack . get ( simpleRef ) + 1 ) ; } if ( refStack . get ( simpleRef ) <= MAX_RECURSION_TO_DISPLAY ) { if ( model instanceof ComposedModel ) { example = exampleMapForProperties ( getPropertiesForComposedModel ( ( ComposedModel ) model , definitions ) , definitions , markupDocBuilder , refStack ) ; } else { example = exampleMapForProperties ( model . getProperties ( ) , definitions , markupDocBuilder , refStack ) ; } } else { return "..." ; } refStack . put ( simpleRef , refStack . get ( simpleRef ) - 1 ) ; } } return example ; }
generates an example object from a simple reference
