/** * Find the source file for this type * * @param type * @throws Exception */ public String getSourceFileFor(TypeRef type) throws Exception { Set<File> sp = Collections.singleton(getFile(getProperty(DEFAULT_PROP_SRC_DIR, "src"))); return getSourceFileFor(type, sp); }
/** * Find the source file for this type * * @param type * @throws Exception */ public String getSourceFileFor(TypeRef type) throws Exception { Set<File> sp = Collections.singleton(getFile(getProperty(DEFAULT_PROP_SRC_DIR, "src"))); return getSourceFileFor(type, sp); }
/** * Set location information for a type. */ public void setTypeLocation(SetLocation location, TypeRef type) throws Exception { String sf = getSourceFileFor(type); if (sf != null) { File sff = IO.getFile(sf); if (sff != null) { String names[] = { type.getShorterName(), type.getFQN(), type.getShortName() .replace('$', '.') }; for (String name : names) { FileLine fl = Processor.findHeader(sff, Pattern.compile("(class|interface)\\s*" + name, Pattern.DOTALL)); if (fl != null) fl.set(location); } } location.file(sf); } }
/** * Set location information for a type. */ public void setTypeLocation(SetLocation location, TypeRef type) throws Exception { String sf = getSourceFileFor(type); if (sf != null) { File sff = IO.getFile(sf); if (sff != null) { String names[] = { type.getShorterName(), type.getFQN(), type.getShortName() .replace('$', '.') }; for (String name : names) { FileLine fl = Processor.findHeader(sff, Pattern.compile("(class|interface)\\s*" + name, Pattern.DOTALL)); if (fl != null) fl.set(location); } } location.file(sf); } }
clazz.getFQN()); TypeRef cname = clazz.getClassName(); String source = analyzer.getSourceFileFor(cname); if (source != null) { File f = getFile(source);
clazz.getFQN()); TypeRef cname = clazz.getClassName(); String source = analyzer.getSourceFileFor(cname); if (source != null) { File f = getFile(source);