當前位置: 首頁>>代碼示例>>Java>>正文


Java MemberDeclaration類代碼示例

本文整理匯總了Java中org.eclipse.xtend.lib.macro.declaration.MemberDeclaration的典型用法代碼示例。如果您正苦於以下問題:Java MemberDeclaration類的具體用法?Java MemberDeclaration怎麽用?Java MemberDeclaration使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MemberDeclaration類屬於org.eclipse.xtend.lib.macro.declaration包,在下文中一共展示了MemberDeclaration類的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getDelegatedInterfaces

import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //導入依賴的package包/類
public Set<TypeReference> getDelegatedInterfaces(final MemberDeclaration delegate) {
  Set<TypeReference> _xblockexpression = null;
  {
    final Set<TypeReference> interfacesOfDeclaringType = this.getImplementedInterfaces(this.context.newSelfTypeReference(delegate.getDeclaringType()));
    final Set<TypeReference> listedInterfaces = this.listedInterfaces(delegate);
    final Set<TypeReference> availableInterfaces = this.getImplementedInterfaces(this.getType(delegate));
    final Function1<TypeReference, Boolean> _function = new Function1<TypeReference, Boolean>() {
      @Override
      public Boolean apply(final TypeReference iface) {
        return Boolean.valueOf((interfacesOfDeclaringType.contains(iface) && (listedInterfaces.isEmpty() || IterableExtensions.<TypeReference>exists(listedInterfaces, new Function1<TypeReference, Boolean>() {
          @Override
          public Boolean apply(final TypeReference it) {
            return Boolean.valueOf(iface.isAssignableFrom(it));
          }
        }))));
      }
    };
    _xblockexpression = IterableExtensions.<TypeReference>toSet(IterableExtensions.<TypeReference>filter(availableInterfaces, _function));
  }
  return _xblockexpression;
}
 
開發者ID:eclipse,項目名稱:xtext-lib,代碼行數:22,代碼來源:DelegateProcessor.java

示例2: hasValidType

import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //導入依賴的package包/類
public boolean hasValidType(final MemberDeclaration it) {
  boolean _xifexpression = false;
  if (((this.getType(it) == null) || this.getType(it).isInferred())) {
    boolean _xblockexpression = false;
    {
      this.context.addError(it, "Cannot use inferred types on delegates");
      _xblockexpression = false;
    }
    _xifexpression = _xblockexpression;
  } else {
    _xifexpression = true;
  }
  return _xifexpression;
}
 
開發者ID:eclipse,項目名稱:xtext-lib,代碼行數:15,代碼來源:DelegateProcessor.java

示例3: hasDelegationConflicts

import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //導入依賴的package包/類
public boolean hasDelegationConflicts(final MemberDeclaration delegate) {
  boolean _xblockexpression = false;
  {
    boolean conflict = false;
    Iterable<? extends MemberDeclaration> _otherDelegates = this.otherDelegates(delegate);
    for (final MemberDeclaration other : _otherDelegates) {
      {
        final Set<TypeReference> otherInterfaces = this.getDelegatedInterfaces(other);
        Set<TypeReference> _delegatedInterfaces = this.getDelegatedInterfaces(delegate);
        for (final TypeReference iface : _delegatedInterfaces) {
          boolean _contains = otherInterfaces.contains(iface);
          if (_contains) {
            conflict = true;
            StringConcatenation _builder = new StringConcatenation();
            _builder.append("The interface ");
            String _simpleName = iface.getSimpleName();
            _builder.append(_simpleName);
            _builder.append(" is also implemented by the delegate ");
            String _simpleName_1 = other.getSimpleName();
            _builder.append(_simpleName_1);
            this.context.addError(delegate, _builder.toString());
          }
        }
      }
    }
    _xblockexpression = conflict;
  }
  return _xblockexpression;
}
 
開發者ID:eclipse,項目名稱:xtext-lib,代碼行數:30,代碼來源:DelegateProcessor.java

示例4: otherDelegates

import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //導入依賴的package包/類
public Iterable<? extends MemberDeclaration> otherDelegates(final MemberDeclaration delegate) {
  final Function1<MemberDeclaration, Boolean> _function = new Function1<MemberDeclaration, Boolean>() {
    @Override
    public Boolean apply(final MemberDeclaration it) {
      return Boolean.valueOf((!Objects.equal(it, delegate)));
    }
  };
  return IterableExtensions.filter(this.getDelegates(delegate.getDeclaringType()), _function);
}
 
開發者ID:eclipse,項目名稱:xtext-lib,代碼行數:10,代碼來源:DelegateProcessor.java

示例5: isValidDelegate

import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //導入依賴的package包/類
public boolean isValidDelegate(final MemberDeclaration it) {
  if (it instanceof MethodDeclaration) {
    return _isValidDelegate((MethodDeclaration)it);
  } else if (it instanceof FieldDeclaration) {
    return _isValidDelegate((FieldDeclaration)it);
  } else {
    throw new IllegalArgumentException("Unhandled parameter types: " +
      Arrays.<Object>asList(it).toString());
  }
}
 
開發者ID:eclipse,項目名稱:xtext-lib,代碼行數:11,代碼來源:DelegateProcessor.java

示例6: getType

import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //導入依賴的package包/類
public TypeReference getType(final MemberDeclaration it) {
  if (it instanceof MethodDeclaration) {
    return _getType((MethodDeclaration)it);
  } else if (it instanceof FieldDeclaration) {
    return _getType((FieldDeclaration)it);
  } else {
    throw new IllegalArgumentException("Unhandled parameter types: " +
      Arrays.<Object>asList(it).toString());
  }
}
 
開發者ID:eclipse,項目名稱:xtext-lib,代碼行數:11,代碼來源:DelegateProcessor.java

示例7: delegateAccess

import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //導入依賴的package包/類
public CharSequence delegateAccess(final MemberDeclaration it, final MethodDeclaration method) {
  if (it instanceof MethodDeclaration) {
    return _delegateAccess((MethodDeclaration)it, method);
  } else if (it instanceof FieldDeclaration) {
    return _delegateAccess((FieldDeclaration)it, method);
  } else {
    throw new IllegalArgumentException("Unhandled parameter types: " +
      Arrays.<Object>asList(it, method).toString());
  }
}
 
開發者ID:eclipse,項目名稱:xtext-lib,代碼行數:11,代碼來源:DelegateProcessor.java

示例8: hasExecutable

import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //導入依賴的package包/類
public static boolean hasExecutable(final ClassDeclaration cls, final Signature sig) {
  Iterable<? extends MemberDeclaration> _declaredMembers = cls.getDeclaredMembers();
  Iterable<ExecutableDeclaration> _filter = Iterables.<ExecutableDeclaration>filter(_declaredMembers, ExecutableDeclaration.class);
  final Function1<ExecutableDeclaration, Boolean> _function = (ExecutableDeclaration it) -> {
    Signature _signature = CommonQueries.signature(it);
    return Boolean.valueOf(Objects.equal(_signature, sig));
  };
  return IterableExtensions.<ExecutableDeclaration>exists(_filter, _function);
}
 
開發者ID:East196,項目名稱:maker,代碼行數:10,代碼來源:CommonQueries.java

示例9: isStatic

import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //導入依賴的package包/類
public static boolean isStatic(final MemberDeclaration method) {
  if (method instanceof MethodDeclaration) {
    return _isStatic((MethodDeclaration)method);
  } else if (method instanceof FieldDeclaration) {
    return _isStatic((FieldDeclaration)method);
  } else {
    throw new IllegalArgumentException("Unhandled parameter types: " +
      Arrays.<Object>asList(method).toString());
  }
}
 
開發者ID:East196,項目名稱:maker,代碼行數:11,代碼來源:CommonQueries.java

示例10: propertyType

import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //導入依賴的package包/類
public static TypeReference propertyType(final MemberDeclaration method) {
  if (method instanceof MethodDeclaration) {
    return _propertyType((MethodDeclaration)method);
  } else if (method instanceof FieldDeclaration) {
    return _propertyType((FieldDeclaration)method);
  } else {
    throw new IllegalArgumentException("Unhandled parameter types: " +
      Arrays.<Object>asList(method).toString());
  }
}
 
開發者ID:East196,項目名稱:maker,代碼行數:11,代碼來源:CommonQueries.java

示例11: hasExecutable

import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //導入依賴的package包/類
public static boolean hasExecutable(final ClassDeclaration cls, final Signature sig) {
  Iterable<? extends MemberDeclaration> _declaredMembers = cls.getDeclaredMembers();
  Iterable<ExecutableDeclaration> _filter = Iterables.<ExecutableDeclaration>filter(_declaredMembers, ExecutableDeclaration.class);
  final Function1<ExecutableDeclaration,Boolean> _function = new Function1<ExecutableDeclaration,Boolean>() {
    public Boolean apply(final ExecutableDeclaration it) {
      Signature _signature = ASTExtensions.signature(it);
      boolean _equals = Objects.equal(_signature, sig);
      return Boolean.valueOf(_equals);
    }
  };
  boolean _exists = IterableExtensions.<ExecutableDeclaration>exists(_filter, _function);
  return _exists;
}
 
開發者ID:damien-cremilleux,項目名稱:TP4INFO,代碼行數:14,代碼來源:ASTExtensions.java

示例12: listedInterfaces

import org.eclipse.xtend.lib.macro.declaration.MemberDeclaration; //導入依賴的package包/類
public Set<TypeReference> listedInterfaces(final MemberDeclaration it) {
  return IterableExtensions.<TypeReference>toSet(((Iterable<TypeReference>)Conversions.doWrapArray(it.findAnnotation(this.context.findTypeGlobally(Delegate.class)).getClassArrayValue("value"))));
}
 
開發者ID:eclipse,項目名稱:xtext-lib,代碼行數:4,代碼來源:DelegateProcessor.java


注:本文中的org.eclipse.xtend.lib.macro.declaration.MemberDeclaration類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。