本文整理匯總了Java中java.nio.charset.Charset.toString方法的典型用法代碼示例。如果您正苦於以下問題:Java Charset.toString方法的具體用法?Java Charset.toString怎麽用?Java Charset.toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.nio.charset.Charset
的用法示例。
在下文中一共展示了Charset.toString方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: convertCharset
import java.nio.charset.Charset; //導入方法依賴的package包/類
public static String convertCharset(Charset charset) {
String s = charset.toString();
int i = s.indexOf("[");
if (i == -1) {
return s;
}
return s.substring(i + 1, s.length() - 1);
}
示例2: convertCharset
import java.nio.charset.Charset; //導入方法依賴的package包/類
public static String convertCharset(Charset charset) {
String s = charset.toString();
int i = s.indexOf("[");
if (i == -1)
return s;
return s.substring(i + 1, s.length() - 1);
}
示例3: readSpecification
import java.nio.charset.Charset; //導入方法依賴的package包/類
/**
* @see com.fujitsu.vdmjunit.SpecificationReader#readSpecification(Charset, java.util.List)
*/
@Override
protected Interpreter readSpecification(Charset charset, List<File> files) throws Exception
{
ASTModuleList parsedModules = new ASTModuleList();
for (File file: files)
{
LexTokenReader lexer = new LexTokenReader(file, Settings.dialect, charset.toString());
ModuleReader reader = new ModuleReader(lexer);
parsedModules.addAll(reader.readModules());
if (reader.getErrorCount() > 0)
{
printMessages(reader.getErrors());
fail("Syntax errors (see stdout)");
}
}
TCModuleList checkedModules = ClassMapper.getInstance(TCNode.MAPPINGS).init().convert(parsedModules);
TypeChecker checker = new ModuleTypeChecker(checkedModules);
checker.typeCheck();
if (ModuleTypeChecker.getErrorCount() > 0)
{
printMessages(ModuleTypeChecker.getErrors());
fail("Type errors (see stdout)");
}
INModuleList executableModules = ClassMapper.getInstance(INNode.MAPPINGS).init().convert(checkedModules);
return new ModuleInterpreter(executableModules, checkedModules);
}
示例4: readSpecification
import java.nio.charset.Charset; //導入方法依賴的package包/類
/**
* @see com.fujitsu.vdmjunit.SpecificationReader#readSpecification(Charset, java.util.List)
*/
@Override
protected Interpreter readSpecification(Charset charset, List<File> files) throws Exception
{
ASTClassList parsedClasses = new ASTClassList();
for (File file: files)
{
LexTokenReader lexer = new LexTokenReader(file, Settings.dialect, charset.toString());
ClassReader reader = new ClassReader(lexer);
parsedClasses.addAll(reader.readClasses());
if (reader.getErrorCount() > 0)
{
printMessages(reader.getErrors());
fail("Syntax errors (see stdout)");
}
}
if (Settings.dialect == Dialect.VDM_RT)
{
parsedClasses.add(new ASTCPUClassDefinition());
parsedClasses.add(new ASTBUSClassDefinition());
}
TCClassList checkedClasses = ClassMapper.getInstance(TCNode.MAPPINGS).init().convert(parsedClasses);
ClassTypeChecker checker = new ClassTypeChecker(checkedClasses);
checker.typeCheck();
if (ClassTypeChecker.getErrorCount() > 0)
{
printMessages(ClassTypeChecker.getErrors());
fail("Type errors (see stdout)");
}
INClassList executableClasses = ClassMapper.getInstance(INNode.MAPPINGS).init().convert(checkedClasses);
return new ClassInterpreter(executableClasses, checkedClasses);
}
示例5: readSpecification
import java.nio.charset.Charset; //導入方法依賴的package包/類
/**
* @see vdmjunit.SpecificationReader#readSpecification(Charset, java.util.List)
*/
@Override
protected Interpreter readSpecification(Charset charset, List<File> files) throws Exception
{
ModuleList modules = new ModuleList();
for (File file: files)
{
LexTokenReader lexer = new LexTokenReader(file, Settings.dialect, charset.toString());
ModuleReader reader = new ModuleReader(lexer);
modules.addAll(reader.readModules());
if (reader.getErrorCount() > 0)
{
printMessages(reader.getErrors());
fail("Syntax errors (see stdout)");
}
}
ModuleTypeChecker checker = new ModuleTypeChecker(modules);
checker.typeCheck();
if (ModuleTypeChecker.getErrorCount() > 0)
{
printMessages(ModuleTypeChecker.getErrors());
fail("Type errors (see stdout)");
}
return new ModuleInterpreter(modules);
}
示例6: readSpecification
import java.nio.charset.Charset; //導入方法依賴的package包/類
/**
* @see vdmjunit.SpecificationReader#readSpecification(Charset, java.util.List)
*/
@Override
protected Interpreter readSpecification(Charset charset, List<File> files) throws Exception
{
ClassList classes = new ClassList();
for (File file: files)
{
LexTokenReader lexer = new LexTokenReader(file, Settings.dialect, charset.toString());
ClassReader reader = new ClassReader(lexer);
classes.addAll(reader.readClasses());
if (reader.getErrorCount() > 0)
{
printMessages(reader.getErrors());
fail("Syntax errors (see stdout)");
}
}
if (Settings.dialect == Dialect.VDM_RT)
{
classes.add(new CPUClassDefinition());
classes.add(new BUSClassDefinition());
}
ClassTypeChecker checker = new ClassTypeChecker(classes);
checker.typeCheck();
if (ClassTypeChecker.getErrorCount() > 0)
{
printMessages(ClassTypeChecker.getErrors());
fail("Type errors (see stdout)");
}
return new ClassInterpreter(classes);
}