code: public static JCodeModel buildBodyJCodeModel(String basePackage, String schemaLocation, String name, String schema,
  			Annotator annotator) {
  		JCodeModel codeModel = new JCodeModel();
  		SchemaStore schemaStore = new SchemaStore();
  
  		GenerationConfig config = Config.getPojoConfig();
  		if (config == null) {
  			config = getDefaultGenerationConfig();
  		}
  		if (annotator == null) {
  			annotator = new Jackson2Annotator(config);
  		}
  		RuleFactory ruleFactory = new RuleFactory(config, annotator, schemaStore);
  
  		SchemaMapper mapper = new SchemaMapper(ruleFactory, new SchemaGenerator());
  		boolean useParent = StringUtils.hasText(schemaLocation);
  		try {
  			if (useParent) {
  				mapper.generate(codeModel, name, basePackage, schema, new URI(schemaLocation));
  			} else {
  				mapper.generate(codeModel, name, basePackage, schema);
  			}
  
  		} catch (Exception e) {
  			// TODO make this smarter by checking refs
  			if (useParent && e.getMessage().contains("classpath")) {
  				logger.debug("Referenced Schema contains self $refs or not found in classpath. Regenerating model withouth classpath: for "
  						+ name);
  				codeModel = new JCodeModel();
  				try {
  					mapper.generate(codeModel, name, basePackage, schema);
  					return codeModel;
  				} catch (IOException e1) {
  					// do nothing
  				}
  			}
  			logger.error("Error generating pojo from schema" + name, e);
  			return null;
  		}
  		return codeModel;
  	}
docs: Builds a JCodeModel for classes that will be used as Request or Response
  bodies
  
  @param basePackage
  The package we will be using for the domain objects
  @param schemaLocation
  The location of this schema, will be used to create absolute
  URIs for $ref tags eg "classpath:/"
  @param name
  The class name
  @param schema
  The JSON Schema representing this class
  @param annotator
  JsonSchema2Pojo annotator. if null a default annotator will be
  used
  @return built JCodeModel