|
org.netbeans.modules.queries/1 1.10 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.spi.queries.FileEncodingQueryImplementation
public abstract class FileEncodingQueryImplementation
Information about encoding of a file.
A default implementations are registered by the
org.netbeans.modules.projectapi module which firstly looks up the
implementation of this interface in the DataObject lookup. When
available it delegates to it. When the implementation isn't available in the
DataObject lookup or it returns null it tries to find a
project corresponding to the file and checks whether that project has an
implementation of this interface in its lookup. If so, it delegates to
that implementation. Therefore it is not generally necessary
for a project type provider nor data loader to register its own global implementation of
this query.
Typical implementation returns a Charset for recognized file. The
implementation which needs to analyze the content of the file (XML, HTML)
should implement a subclass of the Charset and provide own CharsetEncoder
end CharsetDecoder which buffer the input up to 4 KB and either delegate
to the correct Charset when the encoding is found in the buffer or signal
that they are not able to process the file and other Charset should be used
by calling the throwUnknownEncoding() method.
1.9| Constructor Summary | |
|---|---|
FileEncodingQueryImplementation()
|
|
| Method Summary | |
|---|---|
abstract Charset |
getEncoding(FileObject file)
Returns encoding of a given file. |
protected static void |
throwUnknownEncoding()
By calling this method the CharsetEncoder and
CharsetDecoder signal that they are not able to handle
the document and the other Charset should be used. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileEncodingQueryImplementation()
| Method Detail |
|---|
public abstract Charset getEncoding(FileObject file)
file - to find an encoding for
protected static void throwUnknownEncoding()
CharsetEncoder and
CharsetDecoder signal that they are not able to handle
the document and the other Charset should be used. This
method may be called during processing the first 4 KB of data and
before any output has been written.
|
org.netbeans.modules.queries/1 1.10 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||