if (imp != null) { boolean fail = false; for (Class<? extends CssResource> clazz : imp.value()) { JClassType importType = typeOracle.findType(clazz.getName().replace( '$', '.'));
if (imp != null) { boolean fail = false; for (Class<? extends CssResource> clazz : imp.value()) { JClassType importType = typeOracle.findType(clazz.getName().replace( '$', '.'));
if (imp != null) { boolean fail = false; for (Class<? extends CssResource> clazz : imp.value()) { JClassType importType = typeOracle.findType(clazz.getName().replace( '$', '.'));
private Map<String, Map<String, String>> computeReplacements(JMethod method, TreeLogger logger, ResourceContext context) throws UnableToCompleteException { Map<String, Map<String, String>> replacementsWithPrefix = new HashMap<String, Map<String, String>>(); replacementsWithPrefix .put("", computeReplacementsForType(method.getReturnType().isInterface())); // Process the Import annotation if any Import imp = method.getAnnotation(Import.class); if (imp != null) { boolean fail = false; TypeOracle typeOracle = context.getGeneratorContext().getTypeOracle(); for (Class<? extends CssResource> clazz : imp.value()) { JClassType importType = typeOracle.findType(clazz.getName().replace('$', '.')); assert importType != null : "TypeOracle does not have type " + clazz.getName(); // add this import type as a requirement for this generator context.getRequirements().addTypeHierarchy(importType); String prefix = getImportPrefix(importType); if (replacementsWithPrefix.put(prefix, computeReplacementsForType(importType)) != null) { logger.log(TreeLogger.ERROR, "Multiple imports that would use the prefix " + prefix); fail = true; } } if (fail) { throw new UnableToCompleteException(); } } return replacementsWithPrefix; }
private Map<String, Map<String, String>> computeReplacements(JMethod method, TreeLogger logger, ResourceContext context) throws UnableToCompleteException { Map<String, Map<String, String>> replacementsWithPrefix = new HashMap<String, Map<String, String>>(); replacementsWithPrefix .put("", computeReplacementsForType(method.getReturnType().isInterface())); // Process the Import annotation if any Import imp = method.getAnnotation(Import.class); if (imp != null) { boolean fail = false; TypeOracle typeOracle = context.getGeneratorContext().getTypeOracle(); for (Class<? extends CssResource> clazz : imp.value()) { JClassType importType = typeOracle.findType(clazz.getName().replace('$', '.')); assert importType != null : "TypeOracle does not have type " + clazz.getName(); // add this import type as a requirement for this generator context.getRequirements().addTypeHierarchy(importType); String prefix = getImportPrefix(importType); if (replacementsWithPrefix.put(prefix, computeReplacementsForType(importType)) != null) { logger.log(TreeLogger.ERROR, "Multiple imports that would use the prefix " + prefix); fail = true; } } if (fail) { throw new UnableToCompleteException(); } } return replacementsWithPrefix; }
private Map<String, Map<String, String>> computeReplacements(JMethod method, TreeLogger logger, ResourceContext context) throws UnableToCompleteException { Map<String, Map<String, String>> replacementsWithPrefix = new HashMap<String, Map<String, String>>(); replacementsWithPrefix .put("", computeReplacementsForType(method.getReturnType().isInterface())); // Process the Import annotation if any Import imp = method.getAnnotation(Import.class); if (imp != null) { boolean fail = false; TypeOracle typeOracle = context.getGeneratorContext().getTypeOracle(); for (Class<? extends CssResource> clazz : imp.value()) { JClassType importType = typeOracle.findType(clazz.getName().replace('$', '.')); assert importType != null : "TypeOracle does not have type " + clazz.getName(); // add this import type as a requirement for this generator context.getRequirements().addTypeHierarchy(importType); String prefix = getImportPrefix(importType); if (replacementsWithPrefix.put(prefix, computeReplacementsForType(importType)) != null) { logger.log(TreeLogger.ERROR, "Multiple imports that would use the prefix " + prefix); fail = true; } } if (fail) { throw new UnableToCompleteException(); } } return replacementsWithPrefix; }