本文整理汇总了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);
}