Tabnine Logo
FileKey.newName
Code IndexAdd Tabnine to your IDE (free)

How to use
newName
method
in
juzu.impl.common.FileKey

Best Java code snippets using juzu.impl.common.FileKey.newName (Showing top 14 results out of 315)

origin: org.juzu/juzu-core

public static FileKey newName(String packageName, String name) {
 int pos = name.indexOf('.');
 String rawName;
 String ext;
 if (pos == -1) {
  rawName = name;
  ext = "";
 } else {
  rawName = name.substring(0, pos);
  ext = name.substring(pos + 1);
 }
 return newName(packageName, rawName, ext);
}
origin: juzu/juzu

public static FileKey newName(String packageName, String name) {
 int pos = name.indexOf('.');
 String rawName;
 String ext;
 if (pos == -1) {
  rawName = name;
  ext = "";
 } else {
  rawName = name.substring(0, pos);
  ext = name.substring(pos + 1);
 }
 return newName(packageName, rawName, ext);
}
origin: org.juzu/juzu-core

public static FileKey newResourceName(String packageName, String name) {
 FileKey key = newName(packageName, name);
 if (key.getKind() == JavaFileObject.Kind.OTHER) {
  return key;
 } else {
  throw new IllegalArgumentException();
 }
}
origin: org.juzu/juzu-core

/**
 * Resolve a resource from the provided context and path.
 *
 * @param context the context of the application that will help to resolve the path source code
 * @param path the path of the resource to resolve
 * @return the resolved resource or null if it cannot be determined
 * @throws NullPointerException if any argument is null
 * @throws IllegalArgumentException if the context package is not valid
 */
public FileObject resolveResourceFromSourcePath(ElementHandle.Package context, Path.Absolute path) throws NullPointerException, IllegalArgumentException {
 return resolveResourceFromSourcePath(context, FileKey.newName(path));
}
origin: juzu/juzu

/**
 * Resolve a resource from the provided context and path.
 *
 * @param context the context of the application that will help to resolve the path source code
 * @param path the path of the resource to resolve
 * @return the resolved resource or null if it cannot be determined
 * @throws NullPointerException if any argument is null
 * @throws IllegalArgumentException if the context package is not valid
 */
public FileObject resolveResourceFromClassPath(ElementHandle.Package context, Path.Absolute path) throws NullPointerException, IllegalArgumentException {
 return resolveResourceFromClassPath(context, FileKey.newName(path));
}
origin: juzu/juzu

/**
 * Resolve a resource from the provided context and path.
 *
 * @param context the context of the application that will help to resolve the path source code
 * @param path the path of the resource to resolve
 * @return the resolved resource or null if it cannot be determined
 * @throws NullPointerException if any argument is null
 * @throws IllegalArgumentException if the context package is not valid
 */
public FileObject resolveResourceFromSourcePath(ElementHandle.Package context, Path.Absolute path) throws NullPointerException, IllegalArgumentException {
 return resolveResourceFromSourcePath(context, FileKey.newName(path));
}
origin: juzu/juzu

public static FileKey newResourceName(String packageName, String rawName, String ext) {
 FileKey key = newName(packageName, rawName, ext);
 if (key.getKind() == JavaFileObject.Kind.OTHER) {
  return key;
 } else {
  throw new IllegalArgumentException();
 }
}
origin: org.juzu/juzu-core

public static FileKey newResourceName(String packageName, String rawName, String ext) {
 FileKey key = newName(packageName, rawName, ext);
 if (key.getKind() == JavaFileObject.Kind.OTHER) {
  return key;
 } else {
  throw new IllegalArgumentException();
 }
}
origin: org.juzu/juzu-core

/**
 * Resolve a resource from the provided context and path.
 *
 * @param context the context of the application that will help to resolve the path source code
 * @param path the path of the resource to resolve
 * @return the resolved resource or null if it cannot be determined
 * @throws NullPointerException if any argument is null
 * @throws IllegalArgumentException if the context package is not valid
 */
public FileObject resolveResourceFromClassPath(ElementHandle.Package context, Path.Absolute path) throws NullPointerException, IllegalArgumentException {
 return resolveResourceFromClassPath(context, FileKey.newName(path));
}
origin: juzu/juzu

public static FileKey newResourceName(String packageName, String name) {
 FileKey key = newName(packageName, name);
 if (key.getKind() == JavaFileObject.Kind.OTHER) {
  return key;
 } else {
  throw new IllegalArgumentException();
 }
}
origin: juzu/juzu

 private void list(
  String packageName,
  P root,
  Set<JavaFileObject.Kind> kinds,
  boolean recurse,
  Collection<JavaFileObject> to) throws IOException {
  for (Iterator<P> i = fs.getChildren(root);i.hasNext();) {
   P child = i.next();
   if (fs.isDir(child)) {
    if (recurse) {
     String name = fs.getName(child);
     list(packageName.isEmpty() ? name : packageName + "." + name, child, kinds, true, to);
    }
   }
   else {
    String name = fs.getName(child);
    FileKey key = FileKey.newName(packageName, name);
    if (kinds.contains(key.getKind())) {
     to.add(getReadable(key));
    }
   }
  }
 }
}
origin: org.juzu/juzu-core

 private void list(
  String packageName,
  P root,
  Set<JavaFileObject.Kind> kinds,
  boolean recurse,
  Collection<JavaFileObject> to) throws IOException {
  for (Iterator<P> i = fs.getChildren(root);i.hasNext();) {
   P child = i.next();
   if (fs.isDir(child)) {
    if (recurse) {
     String name = fs.getName(child);
     list(packageName.isEmpty() ? name : packageName + "." + name, child, kinds, true, to);
    }
   }
   else {
    String name = fs.getName(child);
    FileKey key = FileKey.newName(packageName, name);
    if (kinds.contains(key.getKind())) {
     to.add(getReadable(key));
    }
   }
  }
 }
}
origin: org.juzu/juzu-core

 @Override
 public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
  if (count++ == 0) {
   try {
    ProcessingContext ctx = new ProcessingContext(processingEnv);
    ElementHandle.Package pkg = ElementHandle.Package.create(ctx.getPackageElement("compiler.dot.foo"));
    FileObject file = ctx.resolveResourceFromSourcePath(pkg, FileKey.newName("compiler.dot.foo", "a.b.txt"));
    InputStream in = file.openInputStream();
    FileObject o = ctx.createResource(StandardLocation.CLASS_OUTPUT, FileKey.newName("compiler.dot.foo", "a.b.css"));
    OutputStream out = o.openOutputStream();
    Tools.copy(in, out);
    Tools.safeClose(in);
    Tools.safeClose(out);
   }
   catch (Exception e) {
    throw failure(e);
   }
  }
  return true;
 }
});
origin: juzu/juzu

 @Override
 public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
  if (count++ == 0) {
   try {
    ProcessingContext ctx = new ProcessingContext(processingEnv);
    ElementHandle.Package pkg = ElementHandle.Package.create(ctx.getPackageElement("compiler.dot.foo"));
    FileObject file = ctx.resolveResourceFromSourcePath(pkg, FileKey.newName("compiler.dot.foo", "a.b.txt"));
    InputStream in = file.openInputStream();
    FileObject o = ctx.createResource(StandardLocation.CLASS_OUTPUT, FileKey.newName("compiler.dot.foo", "a.b.css"));
    OutputStream out = o.openOutputStream();
    Tools.copy(in, out);
    Tools.safeClose(in);
    Tools.safeClose(out);
   }
   catch (Exception e) {
    throw failure(e);
   }
  }
  return true;
 }
});
juzu.impl.commonFileKeynewName

Popular methods of FileKey

  • newResourceName
  • <init>
  • equals
  • getKind
  • newJavaName
  • toString

Popular in Java

  • Creating JSON documents from java classes using gson
  • getContentResolver (Context)
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Join (org.hibernate.mapping)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now