站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

FileEncodingQuery (General Queries API) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.queries/1 1.10

org.netbeans.api.queries
Class FileEncodingQuery

java.lang.Object
  extended by org.netbeans.api.queries.FileEncodingQuery

public class FileEncodingQuery
extends Object

The query is used for finding encoding of files. The query should be used when reading or writing files to use the correct encoding.

Since:
org.netbeans.modules.queries/1 1.9
See Also:
FileEncodingQueryImplementation

Method Summary
static Charset getDefaultEncoding()
          Returns the encoding which should be used for newly created projects.
static Charset getEncoding(FileObject file)
          Returns encoding of given file.
static void setDefaultEncoding(Charset encoding)
          Sets the encoding which should be used for newly created projects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getEncoding

public static Charset getEncoding(FileObject file)
Returns encoding of given file.

Parameters:
file - to find an encoding for
Returns:
encoding which should be used for given file, never returns null.

getDefaultEncoding

public static Charset getDefaultEncoding()
Returns the encoding which should be used for newly created projects. The typical user of this method is a code generating new projects. The returned value is a last used encoding set for project.

Returns:
the default encoding

setDefaultEncoding

public static void setDefaultEncoding(Charset encoding)
Sets the encoding which should be used for newly created projects. The typical user of this method is a project customizer, when the user sets a new encoding the customizer code should update the defaul encoding by this method.

Parameters:
encoding - the new default encoding

org.netbeans.modules.queries/1 1.10

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.