FileObject obj = processingEnv.getFiler().getResource(StandardLocation.SOURCE_PATH, "", typeElt.getQualifiedName().toString().replace('.', '/') + ".java"); File srcFolder = new File(obj.toUri()).getParentFile(); String filename = Case.SNAKE.format(Case.CAMEL.parse(typeElt.getSimpleName().toString())); for (Lang lang : langs) { if (isSkipped(typeElt, lang)) {
/** * Convert a name from this case to the {@literal dest} case * @param dest the destination case * @param name the name to convert * @return the converted name */ public String to(Case dest, String name) { return dest.format(parse(name)); }
/** * @param _case the formatting case * @return the module name in the specified case */ public String getName(Case _case) { return _case.format(Case.KEBAB.parse(name)); } }
public String getSimpleName(Case _case) { return _case.format(Case.CAMEL.parse(simpleName)); }
public String getName(Case _case) { return _case.format(Case.CAMEL.parse(name)); }
public String getName(Case _case) { return _case.format(Case.CAMEL.parse(name)); }
static TypeNameTranslator composite(String lang) { return (module, qualifiedName) -> { List<String> def = new ArrayList<>(Case.QUALIFIED.parse(module.getGroupPackage())); def.add(lang); List<String> abc = Case.KEBAB.parse(module.getName()); if (abc.get(0).equals("vertx")) { // Special case if (abc.size() == 1) { def.add("core"); } else { for (int i = 1;i < abc.size();i++) { def.add(abc.get(i)); } } } else { def.addAll(abc); } if (qualifiedName.startsWith(module.getPackageName())) { if (qualifiedName.equals(module.getPackageName())) { } else { String nameInPackage = qualifiedName.substring(module.getPackageName().length() + 1); def.addAll(Case.QUALIFIED.parse(nameInPackage)); } return Case.QUALIFIED.format(def); } return qualifiedName; }; }
private void assertCase(Case _case, String expected, String... atoms) { assertEquals(expected, _case.format(Arrays.asList(atoms))); }
ClassTypeInfo ct = type.getRaw(); return "../../jsdoc/module-" + ct.getModule().getName(Case.KEBAB) + "-js_" + Case.SNAKE.format(Case.CAMEL.parse(elt.getSimpleName().toString())) + "-" + elt.getSimpleName() + ".html";
private String kotlinType(TypeInfo type) { if (type instanceof VoidTypeInfo) { return "Unit"; } else if (type instanceof PrimitiveTypeInfo) { return Case.CAMEL.format(Collections.singletonList(type.getSimpleName())); } else if (type.getKind() == ClassKind.BOXED_PRIMITIVE) { switch (type.getSimpleName()) { case "Integer": return "Int"; case "Character": return "Char"; default: return type.getSimpleName(); } } else if ("java.lang.Void".equals(type.getName())) { return "Unit"; } else if ("java.lang.Object".equals(type.getName())) { return "Any"; } else { if (type instanceof ParameterizedTypeInfo) { List<TypeInfo> args = ((ParameterizedTypeInfo) type).getArgs(); return type.getRaw().getSimpleName() + args.stream().map(this::kotlinType).collect(Collectors.joining(",", "<", ">")); } else { return type.getSimpleName(); } } }