/** * Return the names of the class(es) from the given arg. * * @param arg a class name, .java file, .class file, or metadata * file naming the type(s) to act on * @throws IllegalArgumentException with appropriate message on error */ public String[] parseTypeNames(String arg) { if (arg == null) return new String[0]; try { File file = Files.getFile(arg, _loader); if (arg.endsWith(".class")) return new String[]{ getFromClassFile(file) }; if (arg.endsWith(".java")) return new String[]{ getFromJavaFile(file) }; if ((AccessController.doPrivileged( J2DoPrivHelper.existsAction(file))).booleanValue()) { Collection<String> col = getFromMetaDataFile(file); return col.toArray(new String[col.size()]); } } catch (Exception e) { throw new RuntimeException( _loc.get("class-arg", arg).getMessage(), e); } // must be a class name return new String[]{ arg }; }
/** * Return the names of the class(es) from the given arg. * * @param arg a class name, .java file, .class file, or metadata * file naming the type(s) to act on * @throws IllegalArgumentException with appropriate message on error */ public String[] parseTypeNames(String arg) { if (arg == null) return new String[0]; try { File file = Files.getFile(arg, _loader); if (arg.endsWith(".class")) return new String[]{ getFromClassFile(file) }; if (arg.endsWith(".java")) return new String[]{ getFromJavaFile(file) }; if ((AccessController.doPrivileged( J2DoPrivHelper.existsAction(file))).booleanValue()) { Collection<String> col = getFromMetaDataFile(file); return col.toArray(new String[col.size()]); } } catch (Exception e) { throw new RuntimeException( _loc.get("class-arg", arg).getMessage(), e); } // must be a class name return new String[]{ arg }; }
/** * Return the names of the class(es) from the given arg. * * @param arg a class name, .java file, .class file, or metadata * file naming the type(s) to act on * @throws IllegalArgumentException with appropriate message on error */ public String[] parseTypeNames(String arg) { if (arg == null) return new String[0]; try { File file = Files.getFile(arg, _loader); if (arg.endsWith(".class")) return new String[]{ getFromClassFile(file) }; if (arg.endsWith(".java")) return new String[]{ getFromJavaFile(file) }; if ((AccessController.doPrivileged( J2DoPrivHelper.existsAction(file))).booleanValue()) { Collection<String> col = getFromMetaDataFile(file); return col.toArray(new String[col.size()]); } } catch (Exception e) { throw new NestableRuntimeException( _loc.get("class-arg", arg).getMessage(), e); } // must be a class name return new String[]{ arg }; }
/** * Return the names of the class(es) from the given arg. * * @param arg a class name, .java file, .class file, or metadata * file naming the type(s) to act on * @throws IllegalArgumentException with appropriate message on error */ public String[] parseTypeNames(String arg) { if (arg == null) return new String[0]; try { File file = Files.getFile(arg, _loader); if (arg.endsWith(".class")) return new String[]{ getFromClassFile(file) }; if (arg.endsWith(".java")) return new String[]{ getFromJavaFile(file) }; if (((Boolean) AccessController.doPrivileged( J2DoPrivHelper.existsAction(file))).booleanValue()) { Collection col = getFromMetaDataFile(file); return (String[]) col.toArray(new String[col.size()]); } } catch (Exception e) { throw new NestableRuntimeException( _loc.get("class-arg", arg).getMessage(), e); } // must be a class name return new String[]{ arg }; }