org.eclipse.xtend.lib.annotations.Accessors Java Examples

The following examples show how to use org.eclipse.xtend.lib.annotations.Accessors. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FinalFieldsConstructorProcessor.java    From xtext-lib with Eclipse Public License 2.0 5 votes vote down vote up
protected void _transform(final MutableClassDeclaration it, @Extension final TransformationContext context) {
  AnnotationReference _findAnnotation = it.findAnnotation(context.findTypeGlobally(Data.class));
  boolean _tripleNotEquals = (_findAnnotation != null);
  if (_tripleNotEquals) {
    return;
  }
  AnnotationReference _findAnnotation_1 = it.findAnnotation(context.findTypeGlobally(Accessors.class));
  boolean _tripleNotEquals_1 = (_findAnnotation_1 != null);
  if (_tripleNotEquals_1) {
    return;
  }
  @Extension
  final FinalFieldsConstructorProcessor.Util util = new FinalFieldsConstructorProcessor.Util(context);
  util.addFinalFieldsConstructor(it);
}
 
Example #2
Source File: SARLValidator.java    From sarl with Apache License 2.0 5 votes vote down vote up
/** Replies if the given annotation is an active annotation for object-oriented elements.
 *
 * @param annotation the annotation.
 * @return {@code true} if the annotation should be used only for OO elements.
 * @see #isAOActiveAnnotation(XAnnotation)
 */
@SuppressWarnings("static-method")
protected boolean isOOActiveAnnotation(XAnnotation annotation) {
	final String name = annotation.getAnnotationType().getQualifiedName();
	return Strings.equal(Accessors.class.getName(), name)
			|| Strings.equal(Data.class.getName(), name)
			|| Strings.equal(Delegate.class.getName(), name)
			|| Strings.equal(ToString.class.getName(), name);
}
 
Example #3
Source File: AccessorsProcessor.java    From xtext-lib with Eclipse Public License 2.0 4 votes vote down vote up
public AnnotationReference getAccessorsAnnotation(final AnnotationTarget it) {
  return it.findAnnotation(this.context.findTypeGlobally(Accessors.class));
}
 
Example #4
Source File: SARLValidator.java    From sarl with Apache License 2.0 2 votes vote down vote up
/** Replies if the given container can receive an active annotation.
 *
 * @param annotation the annotation.
 * @return {@code true} if the annotation should be used only for OO elements.
 * @see #isOOActiveAnnotation(XAnnotation)
 * @see #isAOActiveAnnotationReceiver(XtendTypeDeclaration)
 */
@SuppressWarnings("static-method")
protected boolean isAOActiveAnnotation(XAnnotation annotation) {
	final String name = annotation.getAnnotationType().getQualifiedName();
	return Strings.equal(Accessors.class.getName(), name);
}