本文整理匯總了Java中fr.inria.diverse.melange.resource.MelangeRegistry類的典型用法代碼示例。如果您正苦於以下問題:Java MelangeRegistry類的具體用法?Java MelangeRegistry怎麽用?Java MelangeRegistry使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
MelangeRegistry類屬於fr.inria.diverse.melange.resource包,在下文中一共展示了MelangeRegistry類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doAdaptersRegistration
import fr.inria.diverse.melange.resource.MelangeRegistry; //導入依賴的package包/類
public void doAdaptersRegistration() {
MelangeRegistry.LanguageDescriptor xSFSM = new MelangeRegistryImpl.LanguageDescriptorImpl(
"org.eclipse.gemoc.sample.legacyfsm.xsfsm.XSFSM", "", "http://org.eclipse.gemoc.sample.legacyfsm.xsfsm.xsfsm/fsm/", "org.eclipse.gemoc.sample.legacyfsm.xsfsm.XSFSMMT"
);
xSFSM.addAdapter("org.eclipse.gemoc.sample.legacyfsm.fsm.FSMMT", org.eclipse.gemoc.sample.legacyfsm.xsfsm.xsfsm.adapters.fsmmt.XSFSMAdapter.class);
xSFSM.addAdapter("org.eclipse.gemoc.sample.legacyfsm.xsfsm.XSFSMMT", org.eclipse.gemoc.sample.legacyfsm.xsfsm.xsfsm.adapters.xsfsmmt.XSFSMAdapter.class);
MelangeRegistry.INSTANCE.getLanguageMap().put(
"org.eclipse.gemoc.sample.legacyfsm.xsfsm.XSFSM",
xSFSM
);
MelangeRegistry.ModelTypeDescriptor xSFSMMT = new MelangeRegistryImpl.ModelTypeDescriptorImpl(
"org.eclipse.gemoc.sample.legacyfsm.xsfsm.XSFSMMT", "", "http://org.eclipse.gemoc.sample.legacyfsm.xsfsm.xsfsmmt/"
);
xSFSMMT.addSuperType("org.eclipse.gemoc.sample.legacyfsm.fsm.FSMMT");
MelangeRegistry.INSTANCE.getModelTypeMap().put(
"org.eclipse.gemoc.sample.legacyfsm.xsfsm.XSFSMMT",
xSFSMMT
);
}
示例2: doAdaptersRegistration
import fr.inria.diverse.melange.resource.MelangeRegistry; //導入依賴的package包/類
public void doAdaptersRegistration() {
MelangeRegistry.LanguageDescriptor fSM = new MelangeRegistryImpl.LanguageDescriptorImpl(
"org.eclipse.gemoc.sample.legacyfsm.fsm.FSM", "", "http://www.gemoc.org/legacyfsm/fsm", "org.eclipse.gemoc.sample.legacyfsm.fsm.FSMMT"
);
MelangeRegistry.INSTANCE.getLanguageMap().put(
"org.eclipse.gemoc.sample.legacyfsm.fsm.FSM",
fSM
);
MelangeRegistry.ModelTypeDescriptor fSMMT = new MelangeRegistryImpl.ModelTypeDescriptorImpl(
"org.eclipse.gemoc.sample.legacyfsm.fsm.FSMMT", "", "http://org.eclipse.gemoc.sample.legacyfsm.fsm.fsmmt/"
);
MelangeRegistry.INSTANCE.getModelTypeMap().put(
"org.eclipse.gemoc.sample.legacyfsm.fsm.FSMMT",
fSMMT
);
}
示例3: getnsURIMapping
import fr.inria.diverse.melange.resource.MelangeRegistry; //導入依賴的package包/類
protected static HashMap<String, String> getnsURIMapping(IExecutionContext context) {
HashMap<String, String> nsURIMapping = new HashMap<String, String>();
final String langQuery = "lang=";
String melangeQuery = context.getRunConfiguration().getExecutedModelAsMelangeURI().query();
if (melangeQuery != null && !melangeQuery.isEmpty() && melangeQuery.contains(langQuery)) {
String targetLanguage = melangeQuery.substring(melangeQuery.indexOf(langQuery) + langQuery.length());
if (targetLanguage.contains("&")) {
targetLanguage = targetLanguage.substring(0, targetLanguage.indexOf("&"));
}
String targetLanguageNsURI = MelangeRegistry.INSTANCE.getLanguageByIdentifier(targetLanguage).getUri();
// simply open the original model file in a separate ResourceSet
// and ask its root element class nsURI
Object o = EMFResource.getFirstContent(context.getRunConfiguration().getExecutedModelURI());
if (o instanceof EObject) {
EPackage rootPackage = ((EObject) o).eClass().getEPackage();
while (rootPackage.getESuperPackage() != null) {
rootPackage = rootPackage.getESuperPackage();
}
nsURIMapping.put(rootPackage.getNsURI(), targetLanguageNsURI);
}
}
return nsURIMapping;
}
示例4: doAdaptersRegistration
import fr.inria.diverse.melange.resource.MelangeRegistry; //導入依賴的package包/類
public void doAdaptersRegistration() {
MelangeRegistry.LanguageDescriptor fsm = new MelangeRegistryImpl.LanguageDescriptorImpl(
"simplefsmtest.Fsm", "", "http://fsm/", "simplefsmtest.FsmMT"
);
fsm.addAdapter("simplefsmtest.FsmMT", simplefsmtest.fsm.adapters.fsmmt.FsmAdapter.class);
MelangeRegistry.INSTANCE.getLanguageMap().put(
"simplefsmtest.Fsm",
fsm
);
MelangeRegistry.LanguageDescriptor timedFsm = new MelangeRegistryImpl.LanguageDescriptorImpl(
"simplefsmtest.TimedFsm", "", "http://timedfsm/", "simplefsmtest.TimedFsmMT"
);
timedFsm.addAdapter("simplefsmtest.FsmMT", simplefsmtest.timedfsm.adapters.fsmmt.TimedFsmAdapter.class);
timedFsm.addAdapter("simplefsmtest.TimedFsmMT", simplefsmtest.timedfsm.adapters.timedfsmmt.TimedFsmAdapter.class);
MelangeRegistry.INSTANCE.getLanguageMap().put(
"simplefsmtest.TimedFsm",
timedFsm
);
MelangeRegistry.ModelTypeDescriptor fsmMT = new MelangeRegistryImpl.ModelTypeDescriptorImpl(
"simplefsmtest.FsmMT", "", "http://fsmmt/"
);
MelangeRegistry.INSTANCE.getModelTypeMap().put(
"simplefsmtest.FsmMT",
fsmMT
);
MelangeRegistry.ModelTypeDescriptor timedFsmMT = new MelangeRegistryImpl.ModelTypeDescriptorImpl(
"simplefsmtest.TimedFsmMT", "", "http://timedfsmmt/"
);
timedFsmMT.addSuperType("simplefsmtest.FsmMT");
MelangeRegistry.INSTANCE.getModelTypeMap().put(
"simplefsmtest.TimedFsmMT",
timedFsmMT
);
}