Java 类org.eclipse.xtext.documentation.IEObjectDocumentationProviderExtension 实例源码

项目:xtext-extras    文件:JvmModelGenerator.java   
public void generateJavaDoc(final EObject it, final ITreeAppendable appendable, final GeneratorConfig config) {
  final DocumentationAdapter adapter = IterableExtensions.<DocumentationAdapter>head(Iterables.<DocumentationAdapter>filter(it.eAdapters(), DocumentationAdapter.class));
  String _documentation = null;
  if (adapter!=null) {
    _documentation=adapter.getDocumentation();
  }
  boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(_documentation);
  boolean _not = (!_isNullOrEmpty);
  if (_not) {
    final Set<EObject> sourceElements = this.getSourceElements(it);
    if (((sourceElements.size() == 1) && (this.documentationProvider instanceof IEObjectDocumentationProviderExtension))) {
      final List<INode> documentationNodes = ((IEObjectDocumentationProviderExtension) this.documentationProvider).getDocumentationNodes(IterableExtensions.<EObject>head(sourceElements));
      this.addJavaDocImports(it, appendable, documentationNodes);
      this.generateDocumentation(adapter.getDocumentation(), documentationNodes, appendable, config);
    } else {
      this.generateDocumentation(adapter.getDocumentation(), CollectionLiterals.<INode>emptyList(), appendable, config);
    }
  }
}
项目:n4js    文件:N4JSRuntimeModule.java   
/**
 * Bind custom IEObjectDocumentationProviderExtension.
 */
public Class<? extends IEObjectDocumentationProviderExtension> bindIEObjectDocumentationProviderExtension() {
    return N4JSDocumentationProvider.class;
}
项目:xtext-extras    文件:TypeUsageCollector.java   
@Inject
private void setDocumentationProvider(IEObjectDocumentationProvider documentationProvider) {
    if(documentationProvider instanceof IEObjectDocumentationProviderExtension) 
        this.documentationProvider = (IEObjectDocumentationProviderExtension) documentationProvider;
}