/** * Attaches the given documentation to the given jvmElement. */ public void setDocumentation(/* @Nullable */ JvmIdentifiableElement jvmElement, /* @Nullable */ String documentation) { if(jvmElement == null || documentation == null) return; DocumentationAdapter documentationAdapter = new DocumentationAdapter(); documentationAdapter.setDocumentation(documentation); jvmElement.eAdapters().add(documentationAdapter); }
/** * Attaches the given documentation of the source element to the given jvmElement. * * The documentation is computed lazily. */ public void copyDocumentationTo(/* @Nullable */ final EObject source, /* @Nullable */ JvmIdentifiableElement jvmElement) { if(source == null || jvmElement == null) return; DocumentationAdapter documentationAdapter = new DocumentationAdapter() { private boolean computed = false; @Override public String getDocumentation() { if (computed) { return super.getDocumentation(); } String result = JvmTypesBuilder.this.getDocumentation(source); setDocumentation(result); return result; } @Override public void setDocumentation(String documentation) { computed = true; super.setDocumentation(documentation); } }; jvmElement.eAdapters().add(documentationAdapter); }
public void setDocComment(final String docComment) { this.checkMutable(); Adapter _adapter = EcoreUtil.getAdapter(this.getDelegate().eAdapters(), DocumentationAdapter.class); DocumentationAdapter adapter = ((DocumentationAdapter) _adapter); if ((adapter == null)) { DocumentationAdapter _documentationAdapter = new DocumentationAdapter(); adapter = _documentationAdapter; EList<Adapter> _eAdapters = this.getDelegate().eAdapters(); _eAdapters.add(adapter); } adapter.setDocumentation(docComment); }
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getSarlEvent().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getSarlEvent(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getSarlEvent().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getSarlBehavior().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getSarlBehavior(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getSarlBehavior().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getSarlConstructor().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getSarlConstructor(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getSarlConstructor().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getSarlInterface().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getSarlInterface(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getSarlInterface().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getSarlSkill().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getSarlSkill(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getSarlSkill().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getSarlArtifact().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getSarlArtifact(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getSarlArtifact().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getSarlField().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getSarlField(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getSarlField().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getSarlBehaviorUnit().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getSarlBehaviorUnit(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getSarlBehaviorUnit().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getSarlAgent().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getSarlAgent(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getSarlAgent().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getSarlCapacity().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getSarlCapacity(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getSarlCapacity().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getSarlEnumeration().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getSarlEnumeration(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getSarlEnumeration().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getSarlAnnotationType().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getSarlAnnotationType(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getSarlAnnotationType().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getSarlSpace().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getSarlSpace(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getSarlSpace().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getXExpression().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getXExpression(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getXExpression().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getSarlEnumLiteral().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getSarlEnumLiteral(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getSarlEnumLiteral().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getSarlClass().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getSarlClass(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getSarlClass().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }
/** Change the documentation of the element. * * <p>The documentation will be displayed just before the element. * * @param doc the documentation. */ public void setDocumentation(String doc) { if (Strings.isEmpty(doc)) { getSarlAction().eAdapters().removeIf(new Predicate<Adapter>() { public boolean test(Adapter adapter) { return adapter.isAdapterForType(DocumentationAdapter.class); } }); } else { DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter( getSarlAction(), DocumentationAdapter.class); if (adapter == null) { adapter = new DocumentationAdapter(); getSarlAction().eAdapters().add(adapter); } adapter.setDocumentation(doc); } }