本文整理汇总了Java中org.eclipse.xtext.XtextPackage.eINSTANCE方法的典型用法代码示例。如果您正苦于以下问题:Java XtextPackage.eINSTANCE方法的具体用法?Java XtextPackage.eINSTANCE怎么用?Java XtextPackage.eINSTANCE使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.XtextPackage
的用法示例。
在下文中一共展示了XtextPackage.eINSTANCE方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sequence
import org.eclipse.xtext.XtextPackage; //导入方法依赖的package包/类
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
EPackage epackage = semanticObject.eClass().getEPackage();
ParserRule rule = context.getParserRule();
Action action = context.getAssignedAction();
Set<Parameter> parameters = context.getEnabledBooleanParameters();
if (epackage == AnotherSimpleTestPackage.eINSTANCE)
switch (semanticObject.eClass().getClassifierID()) {
case AnotherSimpleTestPackage.FOO:
sequence_Foo(context, (Foo) semanticObject);
return;
}
else if (epackage == XtextPackage.eINSTANCE)
switch (semanticObject.eClass().getClassifierID()) {
case XtextPackage.PARSER_RULE:
sequence_MyRule(context, (ParserRule) semanticObject);
return;
case XtextPackage.RULE_CALL:
sequence_NameRef(context, (RuleCall) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
示例2: getFragmentSegment
import org.eclipse.xtext.XtextPackage; //导入方法依赖的package包/类
@Override
public CharSequence getFragmentSegment(final EObject object) {
EClass eClass = object.eClass();
EPackage ePackage = eClass.getEPackage();
if (ePackage == XtextPackage.eINSTANCE) {
int classifierID = eClass.getClassifierID();
switch (classifierID) {
case XtextPackage.GRAMMAR:
return getFragmentSegment((Grammar) object);
case XtextPackage.ENUM_RULE:
case XtextPackage.PARSER_RULE:
case XtextPackage.TERMINAL_RULE:
return getFragmentSegment((AbstractRule) object);
case XtextPackage.KEYWORD:
if (((Keyword) object).getValue().equals("selectCardinality")) {
return getFragmentSegment((AbstractElement) object);
} else {
return getFragmentSegment((Keyword) object);
}
default:
return super.getFragmentSegment(object);
}
}
return super.getFragmentSegment(object);
}
示例3: isAdapterForType
import org.eclipse.xtext.XtextPackage; //导入方法依赖的package包/类
@Override
public boolean isAdapterForType(Object type) {
return type instanceof EObject && XtextPackage.eINSTANCE == ((EObject) type).eClass().getEPackage();
}