本文整理汇总了Java中org.eclipse.emf.ecore.EEnumLiteral.getLiteral方法的典型用法代码示例。如果您正苦于以下问题:Java EEnumLiteral.getLiteral方法的具体用法?Java EEnumLiteral.getLiteral怎么用?Java EEnumLiteral.getLiteral使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.emf.ecore.EEnumLiteral
的用法示例。
在下文中一共展示了EEnumLiteral.getLiteral方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleEnumAttribute
import org.eclipse.emf.ecore.EEnumLiteral; //导入方法依赖的package包/类
protected Collection<de.darwinspl.preferences.resource.dwprofile.ui.DwprofileCompletionProposal> handleEnumAttribute(de.darwinspl.preferences.resource.dwprofile.mopp.DwprofileExpectedTerminal expectedTerminal, de.darwinspl.preferences.resource.dwprofile.mopp.DwprofileExpectedStructuralFeature expectedFeature, EEnum enumType, String prefix, EObject container) {
Collection<EEnumLiteral> enumLiterals = enumType.getELiterals();
Collection<de.darwinspl.preferences.resource.dwprofile.ui.DwprofileCompletionProposal> result = new LinkedHashSet<de.darwinspl.preferences.resource.dwprofile.ui.DwprofileCompletionProposal>();
for (EEnumLiteral literal : enumLiterals) {
String unResolvedLiteral = literal.getLiteral();
// use token resolver to get de-resolved value of the literal
de.darwinspl.preferences.resource.dwprofile.IDwprofileTokenResolverFactory tokenResolverFactory = metaInformation.getTokenResolverFactory();
de.darwinspl.preferences.resource.dwprofile.IDwprofileTokenResolver tokenResolver = tokenResolverFactory.createTokenResolver(expectedFeature.getTokenName());
String resolvedLiteral = tokenResolver.deResolve(unResolvedLiteral, expectedFeature.getFeature(), container);
boolean matchesPrefix = matches(resolvedLiteral, prefix);
result.add(new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileCompletionProposal(expectedTerminal, resolvedLiteral, prefix, matchesPrefix, expectedFeature.getFeature(), container));
}
return result;
}
示例2: handleEnumAttribute
import org.eclipse.emf.ecore.EEnumLiteral; //导入方法依赖的package包/类
protected Collection<eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionCompletionProposal> handleEnumAttribute(eu.hyvar.feature.expression.resource.hyexpression.mopp.HyexpressionExpectedTerminal expectedTerminal, eu.hyvar.feature.expression.resource.hyexpression.mopp.HyexpressionExpectedStructuralFeature expectedFeature, EEnum enumType, String prefix, EObject container) {
Collection<EEnumLiteral> enumLiterals = enumType.getELiterals();
Collection<eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionCompletionProposal> result = new LinkedHashSet<eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionCompletionProposal>();
for (EEnumLiteral literal : enumLiterals) {
String unResolvedLiteral = literal.getLiteral();
// use token resolver to get de-resolved value of the literal
eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionTokenResolverFactory tokenResolverFactory = metaInformation.getTokenResolverFactory();
eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionTokenResolver tokenResolver = tokenResolverFactory.createTokenResolver(expectedFeature.getTokenName());
String resolvedLiteral = tokenResolver.deResolve(unResolvedLiteral, expectedFeature.getFeature(), container);
boolean matchesPrefix = matches(resolvedLiteral, prefix);
result.add(new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionCompletionProposal(expectedTerminal, resolvedLiteral, prefix, matchesPrefix, expectedFeature.getFeature(), container));
}
return result;
}
示例3: handleEnumAttribute
import org.eclipse.emf.ecore.EEnumLiteral; //导入方法依赖的package包/类
protected Collection<eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaCompletionProposal> handleEnumAttribute(eu.hyvar.context.contextValidity.resource.hyvalidityformula.mopp.HyvalidityformulaExpectedTerminal expectedTerminal, eu.hyvar.context.contextValidity.resource.hyvalidityformula.mopp.HyvalidityformulaExpectedStructuralFeature expectedFeature, EEnum enumType, String prefix, EObject container) {
Collection<EEnumLiteral> enumLiterals = enumType.getELiterals();
Collection<eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaCompletionProposal> result = new LinkedHashSet<eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaCompletionProposal>();
for (EEnumLiteral literal : enumLiterals) {
String unResolvedLiteral = literal.getLiteral();
// use token resolver to get de-resolved value of the literal
eu.hyvar.context.contextValidity.resource.hyvalidityformula.IHyvalidityformulaTokenResolverFactory tokenResolverFactory = metaInformation.getTokenResolverFactory();
eu.hyvar.context.contextValidity.resource.hyvalidityformula.IHyvalidityformulaTokenResolver tokenResolver = tokenResolverFactory.createTokenResolver(expectedFeature.getTokenName());
String resolvedLiteral = tokenResolver.deResolve(unResolvedLiteral, expectedFeature.getFeature(), container);
boolean matchesPrefix = matches(resolvedLiteral, prefix);
result.add(new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaCompletionProposal(expectedTerminal, resolvedLiteral, prefix, matchesPrefix, expectedFeature.getFeature(), container));
}
return result;
}
示例4: handleEnumAttribute
import org.eclipse.emf.ecore.EEnumLiteral; //导入方法依赖的package包/类
protected Collection<eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueCompletionProposal> handleEnumAttribute(eu.hyvar.dataValues.resource.hydatavalue.mopp.HydatavalueExpectedTerminal expectedTerminal, eu.hyvar.dataValues.resource.hydatavalue.mopp.HydatavalueExpectedStructuralFeature expectedFeature, EEnum enumType, String prefix, EObject container) {
Collection<EEnumLiteral> enumLiterals = enumType.getELiterals();
Collection<eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueCompletionProposal> result = new LinkedHashSet<eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueCompletionProposal>();
for (EEnumLiteral literal : enumLiterals) {
String unResolvedLiteral = literal.getLiteral();
// use token resolver to get de-resolved value of the literal
eu.hyvar.dataValues.resource.hydatavalue.IHydatavalueTokenResolverFactory tokenResolverFactory = metaInformation.getTokenResolverFactory();
eu.hyvar.dataValues.resource.hydatavalue.IHydatavalueTokenResolver tokenResolver = tokenResolverFactory.createTokenResolver(expectedFeature.getTokenName());
String resolvedLiteral = tokenResolver.deResolve(unResolvedLiteral, expectedFeature.getFeature(), container);
boolean matchesPrefix = matches(resolvedLiteral, prefix);
result.add(new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueCompletionProposal(expectedTerminal, resolvedLiteral, prefix, matchesPrefix, expectedFeature.getFeature(), container));
}
return result;
}
示例5: handleEnumAttribute
import org.eclipse.emf.ecore.EEnumLiteral; //导入方法依赖的package包/类
protected Collection<eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingCompletionProposal> handleEnumAttribute(eu.hyvar.feature.mapping.resource.hymapping.mopp.HymappingExpectedTerminal expectedTerminal, eu.hyvar.feature.mapping.resource.hymapping.mopp.HymappingExpectedStructuralFeature expectedFeature, EEnum enumType, String prefix, EObject container) {
Collection<EEnumLiteral> enumLiterals = enumType.getELiterals();
Collection<eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingCompletionProposal> result = new LinkedHashSet<eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingCompletionProposal>();
for (EEnumLiteral literal : enumLiterals) {
String unResolvedLiteral = literal.getLiteral();
// use token resolver to get de-resolved value of the literal
eu.hyvar.feature.mapping.resource.hymapping.IHymappingTokenResolverFactory tokenResolverFactory = metaInformation.getTokenResolverFactory();
eu.hyvar.feature.mapping.resource.hymapping.IHymappingTokenResolver tokenResolver = tokenResolverFactory.createTokenResolver(expectedFeature.getTokenName());
String resolvedLiteral = tokenResolver.deResolve(unResolvedLiteral, expectedFeature.getFeature(), container);
boolean matchesPrefix = matches(resolvedLiteral, prefix);
result.add(new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingCompletionProposal(expectedTerminal, resolvedLiteral, prefix, matchesPrefix, expectedFeature.getFeature(), container));
}
return result;
}
示例6: handleEnumAttribute
import org.eclipse.emf.ecore.EEnumLiteral; //导入方法依赖的package包/类
protected Collection<eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsCompletionProposal> handleEnumAttribute(eu.hyvar.feature.constraint.resource.hyconstraints.mopp.HyconstraintsExpectedTerminal expectedTerminal, eu.hyvar.feature.constraint.resource.hyconstraints.mopp.HyconstraintsExpectedStructuralFeature expectedFeature, EEnum enumType, String prefix, EObject container) {
Collection<EEnumLiteral> enumLiterals = enumType.getELiterals();
Collection<eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsCompletionProposal> result = new LinkedHashSet<eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsCompletionProposal>();
for (EEnumLiteral literal : enumLiterals) {
String unResolvedLiteral = literal.getLiteral();
// use token resolver to get de-resolved value of the literal
eu.hyvar.feature.constraint.resource.hyconstraints.IHyconstraintsTokenResolverFactory tokenResolverFactory = metaInformation.getTokenResolverFactory();
eu.hyvar.feature.constraint.resource.hyconstraints.IHyconstraintsTokenResolver tokenResolver = tokenResolverFactory.createTokenResolver(expectedFeature.getTokenName());
String resolvedLiteral = tokenResolver.deResolve(unResolvedLiteral, expectedFeature.getFeature(), container);
boolean matchesPrefix = matches(resolvedLiteral, prefix);
result.add(new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsCompletionProposal(expectedTerminal, resolvedLiteral, prefix, matchesPrefix, expectedFeature.getFeature(), container));
}
return result;
}
示例7: handleEnumAttribute
import org.eclipse.emf.ecore.EEnumLiteral; //导入方法依赖的package包/类
protected Collection<eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestCompletionProposal> handleEnumAttribute(eu.hyvar.mspl.manifest.resource.hymanifest.mopp.HymanifestExpectedTerminal expectedTerminal, eu.hyvar.mspl.manifest.resource.hymanifest.mopp.HymanifestExpectedStructuralFeature expectedFeature, EEnum enumType, String prefix, EObject container) {
Collection<EEnumLiteral> enumLiterals = enumType.getELiterals();
Collection<eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestCompletionProposal> result = new LinkedHashSet<eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestCompletionProposal>();
for (EEnumLiteral literal : enumLiterals) {
String unResolvedLiteral = literal.getLiteral();
// use token resolver to get de-resolved value of the literal
eu.hyvar.mspl.manifest.resource.hymanifest.IHymanifestTokenResolverFactory tokenResolverFactory = metaInformation.getTokenResolverFactory();
eu.hyvar.mspl.manifest.resource.hymanifest.IHymanifestTokenResolver tokenResolver = tokenResolverFactory.createTokenResolver(expectedFeature.getTokenName());
String resolvedLiteral = tokenResolver.deResolve(unResolvedLiteral, expectedFeature.getFeature(), container);
boolean matchesPrefix = matches(resolvedLiteral, prefix);
result.add(new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestCompletionProposal(expectedTerminal, resolvedLiteral, prefix, matchesPrefix, expectedFeature.getFeature(), container));
}
return result;
}
示例8: getDisplayString
import org.eclipse.emf.ecore.EEnumLiteral; //导入方法依赖的package包/类
public static String getDisplayString(Profile profile, Object currentValue) {
if (currentValue != null) {
if (currentValue instanceof Number) {
Unit units = profile.getUnits();
if ((units == null) || (units == Unit.ONE) || units == BINARY_CHOICE) {
return NUMBER_FORMAT.format(currentValue);
}
currentValue = AmountUtils.valueOf((Number)currentValue, units);
}
if (currentValue instanceof String) {
return currentValue.toString();
}
if (currentValue instanceof Boolean) {
return currentValue.toString();
}
if (currentValue instanceof EEnumLiteral) {
EEnumLiteral eEnumLiteral = (EEnumLiteral) currentValue;
return eEnumLiteral.getLiteral();
}
if (currentValue instanceof Amount) {
return EnsembleAmountFormat.INSTANCE.formatAmount((Amount) currentValue);
}
if (currentValue instanceof PowerValue) {
return getDisplayString(profile, ((PowerValue)currentValue).getStateValue());
}
@SuppressWarnings("unchecked")
IStringifier stringifier = StringifierRegistry.getStringifier(currentValue.getClass());
return stringifier.getDisplayString(currentValue);
}
return "N/A";
}
示例9: setParameterStringCaseInsensitive
import org.eclipse.emf.ecore.EEnumLiteral; //导入方法依赖的package包/类
/**
* If the parameter is an EEnum, it is set to the first available literal which equalsIgnoreCase matches newValue
*
* @param element
* @param parameterName
* @param newValue
* @return The value the parameter was set to, in its proper case.
* @throws UndefinedParameterException
*/
public static String setParameterStringCaseInsensitive(EPlanElement element, String parameterName, String newValue) throws UndefinedParameterException {
EObject data = element.getData();
EStructuralFeature feature = getParameterFeature(data, parameterName);
EClassifier type = feature.getEType();
if (type instanceof EEnum) {
EEnum enumType = (EEnum) type;
EEnumLiteral literalValue = getCaseInsensitiveValue(enumType, newValue);
data.eSet(feature, literalValue);
return literalValue == null ? null : literalValue.getLiteral();
} else {
setParameterString(element, parameterName, newValue);
return newValue;
}
}
示例10: addParameterStringToListCaseInsensitive
import org.eclipse.emf.ecore.EEnumLiteral; //导入方法依赖的package包/类
public static String addParameterStringToListCaseInsensitive(EPlanElement element, String parameterName, String newValue) throws UndefinedParameterException {
EObject data = element.getData();
EStructuralFeature feature = getParameterFeature(data, parameterName);
EClassifier type = feature.getEType();
if (type instanceof EEnum) {
EEnum enumType = (EEnum) type;
EEnumLiteral literal = getCaseInsensitiveValue(enumType, newValue);
addParameterObjectToList(element, parameterName, literal);
return literal == null ? null : literal.getLiteral();
} else {
addParameterStringToList(element, parameterName, newValue);
return newValue;
}
}
示例11: cacheLiterals
import org.eclipse.emf.ecore.EEnumLiteral; //导入方法依赖的package包/类
private static Map<String, EEnumLiteral> cacheLiterals(EEnum enumType) {
Map<String, EEnumLiteral> map = new HashMap<String, EEnumLiteral>();
EList<EEnumLiteral> literals = enumType.getELiterals();
for (EEnumLiteral literal : literals) {
String literalString = literal.getLiteral();
map.put(literalString.toUpperCase(), literal);
}
literalValues.put(enumType, map);
return map;
}
示例12: getJuristicMethods
import org.eclipse.emf.ecore.EEnumLiteral; //导入方法依赖的package包/类
private String[][] getJuristicMethods() {
EList<EEnumLiteral> eLiterals = WaqtSalatPackage.Literals.JURISTIC_METHOD.getELiterals();
final String[][] result = new String[eLiterals.size()][2];
int i = 0;
for (Iterator<EEnumLiteral> iterator = eLiterals.iterator(); iterator.hasNext();) {
EEnumLiteral eEnumLiteral = (EEnumLiteral) iterator.next();
result[i][0] = eEnumLiteral.getLiteral();
result[i][1] = eEnumLiteral.getLiteral();
i++;
}
return result;
}