|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jdt.internal.compiler.util.Util
public class Util
Nested Class Summary | |
---|---|
static interface |
Util.Displayable
|
Field Summary | |
---|---|
static int[] |
EMPTY_INT_ARRAY
|
static java.lang.String |
EMPTY_STRING
|
static java.lang.String |
LINE_SEPARATOR
|
static java.lang.String |
UTF_8
|
Fields inherited from interface org.eclipse.jdt.internal.compiler.util.SuffixConstants |
---|
EXTENSION_class, EXTENSION_CLASS, EXTENSION_java, EXTENSION_JAVA, SUFFIX_class, SUFFIX_CLASS, SUFFIX_java, SUFFIX_JAVA, SUFFIX_STRING_class, SUFFIX_STRING_CLASS, SUFFIX_STRING_java, SUFFIX_STRING_JAVA |
Constructor Summary | |
---|---|
Util()
|
Method Summary | |
---|---|
static java.lang.String |
buildAllDirectoriesInto(java.lang.String outputPath,
java.lang.String relativeFileName)
Build all the directories and subdirectories corresponding to the packages names into the directory specified in parameters. |
static char[] |
bytesToChar(byte[] bytes,
java.lang.String encoding)
Returns the given bytes as a char array using a given encoding (null means platform default). |
static int |
computeOuterMostVisibility(TypeDeclaration typeDeclaration,
int visibility)
Returns the outer most enclosing type's visibility for the given TypeDeclaration and visibility based on compiler options. |
static byte[] |
getFileByteContent(java.io.File file)
Returns the contents of the given file as a byte array. |
static char[] |
getFileCharContent(java.io.File file,
java.lang.String encoding)
Returns the contents of the given file as a char array. |
static byte[] |
getInputStreamAsByteArray(java.io.InputStream stream,
int length)
Returns the given input stream's contents as a byte array. |
static char[] |
getInputStreamAsCharArray(java.io.InputStream stream,
int length,
java.lang.String encoding)
Returns the given input stream's contents as a character array. |
static int |
getLineNumber(int position,
int[] lineEnds,
int g,
int d)
|
static byte[] |
getZipEntryByteContent(java.util.zip.ZipEntry ze,
java.util.zip.ZipFile zip)
Returns the contents of the given zip entry as a byte array. |
static boolean |
isClassFileName(char[] name)
Returns true iff str.toLowerCase().endsWith(".class") implementation is not creating extra strings. |
static boolean |
isClassFileName(java.lang.String name)
Returns true iff str.toLowerCase().endsWith(".class") implementation is not creating extra strings. |
static boolean |
isExcluded(char[] path,
char[][] inclusionPatterns,
char[][] exclusionPatterns,
boolean isFolderPath)
|
static boolean |
isJavaFileName(char[] name)
Returns true iff str.toLowerCase().endsWith(".java") implementation is not creating extra strings. |
static boolean |
isJavaFileName(java.lang.String name)
Returns true iff str.toLowerCase().endsWith(".java") implementation is not creating extra strings. |
static boolean |
isPotentialZipArchive(java.lang.String name)
Returns whether the given name is potentially a zip archive file name (it has a file extension and it is not ".java" nor ".class") |
static void |
reverseQuickSort(char[][] list,
int left,
int right)
|
static void |
reverseQuickSort(char[][] list,
int left,
int right,
int[] result)
|
static int |
searchColumnNumber(int[] startLineIndexes,
int lineNumber,
int position)
INTERNAL USE-ONLY Search the column number corresponding to a specific position |
static java.lang.Boolean |
toBoolean(boolean bool)
Converts a boolean value into Boolean. |
static java.lang.String |
toString(java.lang.Object[] objects)
Converts an array of Objects into String. |
static java.lang.String |
toString(java.lang.Object[] objects,
Util.Displayable renderer)
Converts an array of Objects into String. |
static void |
writeToDisk(boolean generatePackagesStructure,
java.lang.String outputPath,
java.lang.String relativeFileName,
ClassFile classFile)
outputPath is formed like: c:\temp\ the last character is a file separator relativeFileName is formed like: java\lang\String.class |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String UTF_8
public static final java.lang.String LINE_SEPARATOR
public static final java.lang.String EMPTY_STRING
public static final int[] EMPTY_INT_ARRAY
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static java.lang.String buildAllDirectoriesInto(java.lang.String outputPath, java.lang.String relativeFileName) throws java.io.IOException
outputPath
- java.lang.StringrelativeFileName
- java.lang.String
java.io.IOException
public static char[] bytesToChar(byte[] bytes, java.lang.String encoding) throws java.io.IOException
java.io.IOException
public static int computeOuterMostVisibility(TypeDeclaration typeDeclaration, int visibility)
public static byte[] getFileByteContent(java.io.File file) throws java.io.IOException
java.io.IOException
- if a problem occured reading the file.public static char[] getFileCharContent(java.io.File file, java.lang.String encoding) throws java.io.IOException
java.io.IOException
- if a problem occured reading the file.public static byte[] getInputStreamAsByteArray(java.io.InputStream stream, int length) throws java.io.IOException
java.io.IOException
- if a problem occured reading the stream.public static char[] getInputStreamAsCharArray(java.io.InputStream stream, int length, java.lang.String encoding) throws java.io.IOException
java.io.IOException
- if a problem occured reading the stream.public static int getLineNumber(int position, int[] lineEnds, int g, int d)
public static byte[] getZipEntryByteContent(java.util.zip.ZipEntry ze, java.util.zip.ZipFile zip) throws java.io.IOException
java.io.IOException
- if a problem occured reading the zip entry.public static final boolean isPotentialZipArchive(java.lang.String name)
public static final boolean isClassFileName(char[] name)
public static final boolean isClassFileName(java.lang.String name)
public static final boolean isExcluded(char[] path, char[][] inclusionPatterns, char[][] exclusionPatterns, boolean isFolderPath)
public static final boolean isJavaFileName(char[] name)
public static final boolean isJavaFileName(java.lang.String name)
public static void reverseQuickSort(char[][] list, int left, int right)
public static void reverseQuickSort(char[][] list, int left, int right, int[] result)
public static final int searchColumnNumber(int[] startLineIndexes, int lineNumber, int position)
public static java.lang.Boolean toBoolean(boolean bool)
bool
- The boolean to convert
public static java.lang.String toString(java.lang.Object[] objects)
public static java.lang.String toString(java.lang.Object[] objects, Util.Displayable renderer)
public static void writeToDisk(boolean generatePackagesStructure, java.lang.String outputPath, java.lang.String relativeFileName, ClassFile classFile) throws java.io.IOException
generatePackagesStructure
- a flag to know if the packages structure has to be generated.outputPath
- the given output directoryrelativeFileName
- the given relative file nameclassFile
- the given classFile to write
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |