/** * Generates a camel case version of a phrase from underscore. * * @param underscore underscore version of a word to converted to camel case. * @return camel case version of underscore. */ public static String camelize(String underscore){ return camelize(underscore, true); }
/** * Generates a camel case version of a phrase from underscore. * * @param underscore underscore version of a word to converted to camel case. * @return camel case version of underscore. */ public static String camelize(String underscore){ return camelize(underscore, true); }
/** * Generates a camel case version of a phrase from underscore. * * @param underscore underscore version of a word to converted to camel case. * @return camel case version of underscore. */ public static String camelize(String underscore){ return camelize(underscore, true); }
@Override public void init() { applicationName = Inflector.camelize(baseDir.getName().toLowerCase().replace('-', '_')); }
@Override public String getEntityName(Class<?> entityClass) { return Inflector.camelize(Inflector.underscore(entityClass.getSimpleName()), false); }
public static Filter getFilter(MultivaluedMap<String, String> queryParams, final List<String> paramNames) { Filter filter = getFilter(queryParams); for (Entry<String, List<String>> entry : queryParams.entrySet()) { if (! paramNames.contains(entry.getKey())) { continue; } if (entry.getValue().size() == 1) { filter.addCondition(Inflector.camelize(entry.getKey(), false), entry.getValue().get(0)); } else { filter.addCondition(Inflector.camelize(entry.getKey(), false), Operator.in, entry.getValue()); } } return filter; }
temp += "." + Inflector.camelize(controller.replace("-", "_"), true) + "Controller"; return temp;
private void buildPath(List<EntityNode> path) { StringWriter writer = new StringWriter(); Iterator<EntityNode> iterator = iterator(); StringBuffer prefix = new StringBuffer(); EntityNode parent = null; StringWriter pathName = new StringWriter(); while (iterator.hasNext()) { EntityNode node = iterator.next(); String name = node.getResourceName(); pathName.append(node.getName()); writer.append("/").append(name); if (iterator.hasNext()) { writer.append("/{" + namingStrategy.getPathSegment(node.getName() + "Id") + "}"); pathName.append("_"); } if (! iterator.hasNext()) { if (parent != null) { prefix = prefix.length() == 0 ? prefix.append(name) : prefix.append(".").append(name); } addSearchFields(prefix.toString(), node); } parent = node; } bulkPath = writer.toString(); singlePath = bulkPath + "/{id}"; name = Inflector.camelize(pathName.toString()); }
static String getControllerClassName(ControllerPath controllerPath) { String name = controllerPath.getControllerName().replace('-', '_'); String temp = Configuration.getRootPackage() + ".controllers"; if (controllerPath.getControllerPackage()!= null) { temp += "." + controllerPath.getControllerPackage(); } return temp + "." + Inflector.camelize(name) + "Controller"; }
private void executeController(Route route) throws IllegalAccessException, InstantiationException { if (RequestContext.getControllerResponse() == null) {//execute controller... only if a filter did not respond String actionMethod = Inflector.camelize(route.getActionName().replace('-', '_'), false); if (checkActionMethod(route.getController(), actionMethod)) { injectController(route.getController()); LOGGER.debug("Executing: " + route.getController() + "#" + actionMethod); executeAction(route.getController(), actionMethod); } } if(injectTags){ injectFreemarkerTags(); } renderResponse(route); processFlash(); }