cli.java
来自「有限状态机程序自动生成器可以自动生成C、C++和Java程序。自动生成的程序很容」· Java 代码 · 共 44 行
JAVA
44 行
package org.abeesoft.fsmgenerator.cli;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import org.abeesoft.fsmgenerator.configuration.Configuration;
import org.abeesoft.fsmgenerator.exception.Exception;
public class CLI implements ICLI
{
protected String args[];
public CLI( String args[] )
{
super();
this.args = args;
}
public Configuration parse() throws Exception
{
Configuration configuration = null;
try
{
JAXBContext jc = JAXBContext.newInstance("org.abeesoft.fsmgenerator.configuration");
Unmarshaller u = jc.createUnmarshaller();
configuration = (Configuration)u.unmarshal(new FileInputStream(args[0]));
}
catch ( JAXBException e )
{
throw new Exception(e);
}
catch ( FileNotFoundException e )
{
throw new Exception(e);
}
return configuration;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?