本文整理汇总了Java中fr.lip6.move.pnml.framework.utils.ModelRepository类的典型用法代码示例。如果您正苦于以下问题:Java ModelRepository类的具体用法?Java ModelRepository怎么用?Java ModelRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModelRepository类属于fr.lip6.move.pnml.framework.utils包,在下文中一共展示了ModelRepository类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PnmlModel
import fr.lip6.move.pnml.framework.utils.ModelRepository; //导入依赖的package包/类
public PnmlModel() {
super();
model = null;
doc = null;
try {
ModelRepository.getInstance().createDocumentWorkspace("main_workspace");
doc = new PetriNetDocHLAPI();
model = new PetriNetHLAPI("main_net", PNTypeHLAPI.PTNET, new NameHLAPI("main_net"), doc);
} catch (InvalidIDException | VoidRepositoryException e) {
}
}
示例2: fromPNML
import fr.lip6.move.pnml.framework.utils.ModelRepository; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void fromPNML(OMElement locRoot, IdRefLinker idr) throws InnerBuildException, InvalidIDException,
VoidRepositoryException {
//1
//0
//1
//0
@SuppressWarnings("unused")
ArbitrarydeclarationsFactory fact = ArbitrarydeclarationsFactory.eINSTANCE;
//processing id
if (locRoot.getAttributeValue(new QName("id")) != null) {
this.setId(new java.lang.String(locRoot.getAttributeValue(new QName("id"))));
ModelRepository.getInstance().getCurrentIdRepository()
.checkId(new java.lang.String(locRoot.getAttributeValue(new QName("id"))).toString(), this);
}
//processing idref
//processing attributes
if (locRoot.getAttributeValue(new QName("name")) != null) {
try {
this.setName(new String(locRoot.getAttributeValue(new QName("name"))));
} catch (Exception e) {
throw new fr.lip6.move.pnml.framework.utils.exception.InnerBuildException(e);
}
}
//processing sons
}
示例3: modelToFile
import fr.lip6.move.pnml.framework.utils.ModelRepository; //导入依赖的package包/类
@Override
public void modelToFile(AbstractModel model) throws IOException, IllegalResourceException, IllegalModelException {
checkModel(model, PnmlModel.class);
PnmlModel pnmlModel = (PnmlModel) model;
ModelRepository mr = ModelRepository.getInstance();
mr.setPrettyPrintStatus(true);
FileWriter fw = new FileWriter(pnmlModel.getResource().getAbsolutePath());
fw.write(pnmlModel.getDoc().toPNML());
fw.close();
}
示例4: toPNML
import fr.lip6.move.pnml.framework.utils.ModelRepository; //导入依赖的package包/类
/**
* Return the string containing the pnml output
*/
@Override
public String toPNML() {
//id 0
//idref 0
//attributes 0
//sons 0
Boolean prettyPrintStatus = ModelRepository.getInstance().isPrettyPrintActive();
String retline = "";
String headline = "";
PrettyPrintData prpd = null;
if (prettyPrintStatus) {
retline = "\n";
prpd = ModelRepository.getInstance().getPrettyPrintData();
headline = prpd.getCurrentLineHeader();
}
StringBuilder sb = new StringBuilder();
sb.append(headline);
sb.append("<integer");
if (prettyPrintStatus) {
headline = prpd.increaseLineHeaderLevel();
}
//begin attributes, id and id ref processing
sb.append("/>");
sb.append(retline);
//sons, follow processing
/****/
if (prettyPrintStatus) {
headline = prpd.decreaseLineHeaderLevel();
}
return sb.toString();
}
示例5: toPNML
import fr.lip6.move.pnml.framework.utils.ModelRepository; //导入依赖的package包/类
/**
* Return the string containing the pnml output
*/
@Override
public String toPNML() {
//id 0
//idref 0
//attributes 0
//sons 0
Boolean prettyPrintStatus = ModelRepository.getInstance().isPrettyPrintActive();
String retline = "";
String headline = "";
PrettyPrintData prpd = null;
if (prettyPrintStatus) {
retline = "\n";
prpd = ModelRepository.getInstance().getPrettyPrintData();
headline = prpd.getCurrentLineHeader();
}
StringBuilder sb = new StringBuilder();
sb.append(headline);
sb.append("<dot");
if (prettyPrintStatus) {
headline = prpd.increaseLineHeaderLevel();
}
//begin attributes, id and id ref processing
sb.append("/>");
sb.append(retline);
//sons, follow processing
/****/
if (prettyPrintStatus) {
headline = prpd.decreaseLineHeaderLevel();
}
return sb.toString();
}
示例6: FEConstantHLAPI
import fr.lip6.move.pnml.framework.utils.ModelRepository; //导入依赖的package包/类
/**
* this constructor allows you to set all 'settable' values
* excepted container.
*/
public FEConstantHLAPI(
java.lang.String id
, java.lang.String name
) throws InvalidIDException ,VoidRepositoryException {//BEGIN CONSTRUCTOR BODY
FiniteEnumerationsFactory fact = FiniteEnumerationsFactoryImpl.eINSTANCE;
synchronized(fact){item = fact.createFEConstant();}
if(id!=null){
item.setId(ModelRepository.getInstance().getCurrentIdRepository().checkId(id, this));
}
if(name!=null){
item.setName(name);
}
}
示例7: toPNML
import fr.lip6.move.pnml.framework.utils.ModelRepository; //导入依赖的package包/类
/**
* Return the string containing the pnml output
*/
@Override
public void toPNML(FileChannel fc) {
//id 0
//idref 0
//attributes 0
//sons 0
final int bufferSizeKB = 8;
final int bufferSize = bufferSizeKB * 1024;
final ByteBuffer bytebuf = ByteBuffer.allocateDirect(bufferSize);
final String charsetEncoding = PNMLEncoding.ISO_8859_1.getName();
Boolean prettyPrintStatus = ModelRepository.getInstance().isPrettyPrintActive();
String retline = "";
String headline = "";
PrettyPrintData prpd = null;
if (prettyPrintStatus) {
retline = "\n";
prpd = ModelRepository.getInstance().getPrettyPrintData();
headline = prpd.getCurrentLineHeader();
}
StringBuilder sb = new StringBuilder();
sb.append(headline);
sb.append("<string");
if (prettyPrintStatus) {
headline = prpd.increaseLineHeaderLevel();
}
//begin attributes, id and id ref processing
sb.append("/>");
sb.append(retline);
//sons, follow processing
/****/
if (prettyPrintStatus) {
headline = prpd.decreaseLineHeaderLevel();
}
try {
writeIntoStream(bytebuf, fc, sb.toString().getBytes(Charset.forName(charsetEncoding)));
} catch (IOException io) {
io.printStackTrace();
// fail fast
return;
}
sb = null;
}
示例8: toPNML
import fr.lip6.move.pnml.framework.utils.ModelRepository; //导入依赖的package包/类
/**
* Return the string containing the pnml output
*/
@Override
public String toPNML() {
//id 0
//idref 0
//attributes 2
//sons 0
Boolean prettyPrintStatus = ModelRepository.getInstance().isPrettyPrintActive();
String retline = "";
String headline = "";
PrettyPrintData prpd = null;
if (prettyPrintStatus) {
retline = "\n";
prpd = ModelRepository.getInstance().getPrettyPrintData();
headline = prpd.getCurrentLineHeader();
}
StringBuilder sb = new StringBuilder();
sb.append(headline);
sb.append("<position");
if (prettyPrintStatus) {
headline = prpd.increaseLineHeaderLevel();
}
//begin attributes, id and id ref processing
if (getX() != null) {
sb.append(" x");
sb.append("=\"");
sb.append(getX());
sb.append("\"");
}
if (getY() != null) {
sb.append(" y");
sb.append("=\"");
sb.append(getY());
sb.append("\"");
}
sb.append("/>");
sb.append(retline);
//sons, follow processing
/****/
if (prettyPrintStatus) {
headline = prpd.decreaseLineHeaderLevel();
}
return sb.toString();
}
示例9: TransitionHLAPI
import fr.lip6.move.pnml.framework.utils.ModelRepository; //导入依赖的package包/类
/**
* This constructor give access to required stuff only (and container)
*/
public TransitionHLAPI(
java.lang.String id
, PageHLAPI containerPage
) throws InvalidIDException ,VoidRepositoryException {//BEGIN CONSTRUCTOR BODY
PnmlcoremodelFactory fact = PnmlcoremodelFactoryImpl.eINSTANCE;
synchronized(fact){item = fact.createTransition();}
if(id!=null){
item.setId(ModelRepository.getInstance().getCurrentIdRepository().checkId(id, this));
}
if(containerPage!=null)
item.setContainerPage((Page)containerPage.getContainedItem());
}
示例10: setup
import fr.lip6.move.pnml.framework.utils.ModelRepository; //导入依赖的package包/类
@BeforeMethod(groups = { "PetriNetHLAPI", "hlapi" })
public void setup() throws Exception{
//ModelRepository.reset(); ModelRepository.getInstance().createDocumentWorkspace("void");
ModelRepository mr = ModelRepository.getInstance();
mr.createDocumentWorkspace("void");
itemid = new String("unid");
itemtype = PNTypeHLAPI.get(0);
//HlcorestructureFactoryImpl
itemname = new NameHLAPI(new HlcorestructureFactoryImpl().createName());
itemcontainerPetriNetDoc = new PetriNetDocHLAPI(new HlcorestructureFactoryImpl().createPetriNetDoc());
}
示例11: toPNML
import fr.lip6.move.pnml.framework.utils.ModelRepository; //导入依赖的package包/类
/**
* Return the string containing the pnml output
*/
@Override
public String toPNML() {
//id 0
//idref 0
//attributes 0
//sons 1
Boolean prettyPrintStatus = ModelRepository.getInstance().isPrettyPrintActive();
String retline = "";
String headline = "";
PrettyPrintData prpd = null;
if (prettyPrintStatus) {
retline = "\n";
prpd = ModelRepository.getInstance().getPrettyPrintData();
headline = prpd.getCurrentLineHeader();
}
StringBuilder sb = new StringBuilder();
sb.append(headline);
sb.append("<stringconcatenation");
if (prettyPrintStatus) {
headline = prpd.increaseLineHeaderLevel();
}
//begin attributes, id and id ref processing
boolean haveSons = false;
sb.append(">");
sb.append(retline);
//sons, follow processing
if (getSubterm() != null) {
java.util.List<fr.lip6.move.pnml.hlpn.terms.Term> items = getSubterm();
for (Iterator<Term> iterator = items.iterator(); iterator.hasNext();) {
Term item = iterator.next();
sb.append(headline);
sb.append("<");
sb.append("subterm");
sb.append(">");
sb.append(item.toPNML());
sb.append(headline);
sb.append("</");
sb.append("subterm");
sb.append(">");
haveSons = true;
}
}
/****/
if (prettyPrintStatus) {
headline = prpd.decreaseLineHeaderLevel();
}
if (haveSons) {
sb.append(headline);
sb.append("</stringconcatenation>");
sb.append(retline);
} else {
sb.delete(sb.lastIndexOf(">"), sb.length());
sb.append("/>");
}
return sb.toString();
}
示例12: ArbitrarySortHLAPI
import fr.lip6.move.pnml.framework.utils.ModelRepository; //导入依赖的package包/类
/**
* this constructor allows you to set all 'settable' values
* excepted container.
*/
public ArbitrarySortHLAPI(
java.lang.String id
, java.lang.String name
) throws InvalidIDException ,VoidRepositoryException {//BEGIN CONSTRUCTOR BODY
ArbitrarydeclarationsFactory fact = ArbitrarydeclarationsFactoryImpl.eINSTANCE;
synchronized(fact){item = fact.createArbitrarySort();}
if(id!=null){
item.setId(ModelRepository.getInstance().getCurrentIdRepository().checkId(id, this));
}
if(name!=null){
item.setName(name);
}
}
示例13: setIdHLAPI
import fr.lip6.move.pnml.framework.utils.ModelRepository; //导入依赖的package包/类
/**
* set Id
*/
public void setIdHLAPI(
java.lang.String elem) throws InvalidIDException ,VoidRepositoryException {
if(elem!=null){
try{
item.setId(ModelRepository.getInstance().getCurrentIdRepository().changeId(this, elem));
}catch (OtherException e){
ModelRepository.getInstance().getCurrentIdRepository().checkId(elem, this);
}
}
}
示例14: PageHLAPI
import fr.lip6.move.pnml.framework.utils.ModelRepository; //导入依赖的package包/类
/**
* This constructor give access to required stuff only (and container)
*/
public PageHLAPI(
java.lang.String id
, PageHLAPI containerPage
) throws InvalidIDException ,VoidRepositoryException {//BEGIN CONSTRUCTOR BODY
PtnetFactory fact = PtnetFactoryImpl.eINSTANCE;
synchronized(fact){item = fact.createPage();}
if(id!=null){
item.setId(ModelRepository.getInstance().getCurrentIdRepository().checkId(id, this));
}
if(containerPage!=null)
item.setContainerPage((Page)containerPage.getContainedItem());
}
示例15: tearDown
import fr.lip6.move.pnml.framework.utils.ModelRepository; //导入依赖的package包/类
/**
* @throws java.lang.Exception
*/
@AfterMethod(groups = { "pnmltypetests" })
public void tearDown() throws Exception {
ModelRepository.getInstance().destroyCurrentWorkspace();
}