本文整理汇总了Java中org.eclipse.xtext.GrammarUtil.getName方法的典型用法代码示例。如果您正苦于以下问题:Java GrammarUtil.getName方法的具体用法?Java GrammarUtil.getName怎么用?Java GrammarUtil.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.GrammarUtil
的用法示例。
在下文中一共展示了GrammarUtil.getName方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getGuiceBindingsRt
import org.eclipse.xtext.GrammarUtil; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
final BindFactory bindFactory = new BindFactory();
final String namingPrefix = GrammarUtil.getNamespace(grammar) + ".naming." + GrammarUtil.getName(grammar); //$NON-NLS-1$
final String resourcePrefix = GrammarUtil.getNamespace(grammar) + ".resource." + GrammarUtil.getName(grammar); //$NON-NLS-1$
ExportModel m = getModel(grammar);
if (m != null) {
bindFactory.addTypeToType(IQualifiedNameProvider.class.getName(), namingPrefix + "ExportedNamesProvider"); //$NON-NLS-1$
if (!m.getInterfaces().isEmpty()) {
bindFactory.addTypeToType(IFingerprintComputer.class.getName(), resourcePrefix + "FingerprintComputer"); //$NON-NLS-1$
}
if (!m.getExports().isEmpty()) {
bindFactory.addTypeToType(IDefaultResourceDescriptionStrategy.class.getName(), resourcePrefix + "ResourceDescriptionStrategy"); //$NON-NLS-1$
}
if (Iterables.any(m.getExports(), new Predicate<Export>() {
@Override
public boolean apply(final Export input) {
return input.isFingerprint() && input.getFragmentAttribute() != null;
}
})) {
bindFactory.addTypeToType(IFragmentProvider.class.getName(), resourcePrefix + "FragmentProvider");
}
}
bindFactory.addTypeToType(IResourceDescription.Manager.class.getName(), resourcePrefix + "ResourceDescriptionManager"); //$NON-NLS-1$
return bindFactory.getBindings();
}
示例2: getGuiceBindingsRt
import org.eclipse.xtext.GrammarUtil; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
final BindFactory bindFactory = new BindFactory();
final String prefix = GrammarUtil.getNamespace(grammar) + ".scoping." + GrammarUtil.getName(grammar);
bindFactory.addTypeToType(IScopeProvider.class.getName(), prefix + "ScopeProvider");
bindFactory.addTypeToType(IScopeNameProvider.class.getName(), prefix + "ScopeNameProvider");
bindFactory.addTypeToType(ILinkingService.class.getName(), "com.avaloq.tools.ddk.xtext.linking.LinkingService");
return bindFactory.getBindings();
}
示例3: getValidModel
import org.eclipse.xtext.GrammarUtil; //导入方法依赖的package包/类
/**
* Gets the valid model.
*
* @param grammar
* the grammar
* @return the valid model
*/
private ValidModel getValidModel(final Grammar grammar) {
if (model != null) {
return model;
}
Resource resource = null;
final String name = GrammarUtil.getName(grammar) + '.' + XTEXT_EXTENSION;
URI uri;
for (final Resource res : grammar.eResource().getResourceSet().getResources()) {
if (res.getURI() != null && name.equals(EmfResourceUtil.getFileName(res.getURI()))) {
resource = res;
break;
}
}
if (getValidURI() == null) {
Assert.isNotNull(resource, NLS.bind(Messages.RESOURCE_NOT_FOUND, name));
uri = resource.getURI().trimFileExtension().appendFileExtension(VALID_EXTENSION);
} else {
uri = URI.createURI(getValidURI());
}
resource = resource.getResourceSet().getResource(uri, true);
final List<Issue> issues = VALIDATOR.validate(resource, LOGGER);
for (final Issue issue : issues) {
if (issue.isSyntaxError() || issue.getSeverity() == Severity.ERROR) {
throw new WorkflowInterruptedException(NLS.bind(Messages.ERROR_FOUND, uri.toString()));
}
}
model = (ValidModel) resource.getContents().get(0);
return model;
}
示例4: caseGrammar
import org.eclipse.xtext.GrammarUtil; //导入方法依赖的package包/类
@Override
public String caseGrammar(final org.eclipse.xtext.Grammar object) {
return GrammarUtil.getName(object);
}
示例5: getFormatterName
import org.eclipse.xtext.GrammarUtil; //导入方法依赖的package包/类
/**
* Get the qualified class name of the formatter. The class name is prefixed with classNamePrefix.
*
* @param grammar
* the format grammar
* @param classNamePrefix
* the class prefix - may be null
* @return String fully qualified name of the formatter class
*/
public static String getFormatterName(final Grammar grammar, final String classNamePrefix) {
return GrammarUtil.getNamespace(grammar) + ".formatting." + (classNamePrefix == null ? "" : classNamePrefix) + GrammarUtil.getName(grammar) + "Formatter";
}
示例6: getJavaValidatorName
import org.eclipse.xtext.GrammarUtil; //导入方法依赖的package包/类
/**
* Gets the java validator name.
*
* @param grammar
* the grammar
* @param prefix
* the prefix (common usage is "Abstract")
* @return the java validator name
*/
public static String getJavaValidatorName(final Grammar grammar, final String prefix) {
return GrammarUtil.getNamespace(grammar) + ".validation." + prefix + GrammarUtil.getName(grammar) + "JavaValidator"; //$NON-NLS-1$ //$NON-NLS-2$
}
示例7: getPreferencePageName
import org.eclipse.xtext.GrammarUtil; //导入方法依赖的package包/类
/**
* Gets the java validator name.
*
* @param grammar
* the grammar
* @param naming
* generator naming variables and properties
* @return the java validator name
*/
public static String getPreferencePageName(final Grammar grammar, final Naming naming) {
return getPreferencePackage(grammar, naming) + "." + GrammarUtil.getName(grammar) + "ValidPreferencePage"; //$NON-NLS-1$ //$NON-NLS-2$
}
示例8: getQuickfixProviderName
import org.eclipse.xtext.GrammarUtil; //导入方法依赖的package包/类
/**
* Gets the quickfix provider name.
*
* @param grammar
* the grammar
* @param naming
* generator naming variables and properties
* @return the quickfix provider name
*/
public static String getQuickfixProviderName(final Grammar grammar, final Naming naming) {
return getQuickfixPackage(grammar, naming) + "." + GrammarUtil.getName(grammar) + "QuickfixProvider"; //$NON-NLS-1$//$NON-NLS-2$
}
示例9: getCheckValidatorName
import org.eclipse.xtext.GrammarUtil; //导入方法依赖的package包/类
/**
* Gets the check validator name.
*
* @param grammar
* the grammar
* @param naming
* generator naming variables and properties
* @return the check validator name
*/
public static String getCheckValidatorName(final Grammar grammar, final Naming naming) {
return naming.basePackageRuntime(grammar) + ".validation." + GrammarUtil.getName(grammar) + "CheckValidator"; //$NON-NLS-1$//$NON-NLS-2$
}
示例10: getQualifiedName
import org.eclipse.xtext.GrammarUtil; //导入方法依赖的package包/类
/**
* Returns the qualified name of the Constants class.
*
* @param grammar
* the grammar
* @param prefix
* the prefix (e.g. "Abstract", "Default", ...
* @param naming
* the naming
* @return the qualified name
*/
public static String getQualifiedName(final Grammar grammar, final String prefix, final Naming naming) {
return naming.basePackageRuntime(grammar) + "." + prefix + GrammarUtil.getName(grammar) + "Constants"; //$NON-NLS-1$
}