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


Java Modifiers類代碼示例

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


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

示例1: reportMethod

import org.eclipse.dltk.ast.Modifiers; //導入依賴的package包/類
private String reportMethod(GnMethodDeclaration declaration) {
  ASTNode nameNode = declaration.getRef();
  if (declaration.getType() == Type.TEMPLATE_CALL) {
    SimpleReference originalRef = declaration.getOriginalRef();
    fRequestor.acceptMethodReference(originalRef.getName(), declaration.getArguments().size(),
        originalRef.sourceStart(), originalRef.sourceEnd());
    nameNode = declaration.getFirstArgument();
  } else {
    nameNode = declaration.getRef();
  }
  String name = nameNode.toString();
  IElementRequestor.MethodInfo info = new IElementRequestor.MethodInfo();
  info.declarationStart = nameNode.start();
  info.name = name;
  info.nameSourceStart = nameNode.start();
  info.nameSourceEnd = nameNode.end() - 1;
  info.modifiers =
      declaration.getType() == Type.TEMPLATE ? Modifiers.AccPublic : Modifiers.AccPrivate;

  fRequestor.enterMethod(info);
  return name;
}
 
開發者ID:chromium,項目名稱:eclipse-gn,代碼行數:23,代碼來源:GnSourceElementRequestor.java

示例2: addFieldDeclaration

import org.eclipse.dltk.ast.Modifiers; //導入依賴的package包/類
private void addFieldDeclaration(ASTNode left, ASTNode right) {
  if (false == left instanceof GnFieldDeclaration) {
    return;
  }
  GnFieldDeclaration variable = (GnFieldDeclaration) left;
  IElementRequestor.FieldInfo info = new IElementRequestor.FieldInfo();
  info.modifiers =
      variable.getKind() == GnFieldDeclaration.GLOBAL ? Modifiers.AccGlobal
          : Modifiers.AccDefault;
  info.name = variable.getName();
  info.nameSourceEnd = variable.sourceEnd() - 1;
  info.nameSourceStart = variable.sourceStart();
  info.declarationStart = variable.sourceStart();
  fRequestor.enterField(info);
  if (right != null) {
    fRequestor.exitField(right.sourceEnd() - 1);
  } else {
    fRequestor.exitField(left.sourceEnd() - 1);
  }
}
 
開發者ID:chromium,項目名稱:eclipse-gn,代碼行數:21,代碼來源:GnSourceElementRequestor.java

示例3: visitAbstractType

import org.eclipse.dltk.ast.Modifiers; //導入依賴的package包/類
@Override
public ASTNode visitAbstractType(AbstractTypeContext ctx) {
  final Token type = ctx.ID(0).getSymbol();
  final TypeDeclaration typeDeclaration = new TypeDeclaration(type.getText(), start(type),
      stop(type), start(ctx), stop(ctx));
  typeDeclaration.setModifier(Modifiers.AccAbstract);
  if (ctx.SUB_TYPE() != null) {
    final Token superType = ctx.ID(1).getSymbol();
    final TypeReference typeReference = new TypeReference(start(superType), stop(superType),
        superType.getText());
    typeDeclaration.addSuperClass(typeReference);
  }
  return typeDeclaration;
}
 
開發者ID:JuliaComputing,項目名稱:JuliaDT,代碼行數:15,代碼來源:JuliaModuleFactory.java

示例4: visitNamedTypedParam

import org.eclipse.dltk.ast.Modifiers; //導入依賴的package包/類
@Override
public ASTNode visitNamedTypedParam(NamedTypedParamContext ctx) {
  SimpleReference type = (SimpleReference) visit(ctx.typeExpression());
  return new Argument(type, start(ctx), stop(ctx), null, Modifiers.AccPublic);
}
 
開發者ID:JuliaComputing,項目名稱:JuliaDT,代碼行數:6,代碼來源:JuliaModuleFactory.java

示例5: visitNamedParam

import org.eclipse.dltk.ast.Modifiers; //導入依賴的package包/類
@Override
public ASTNode visitNamedParam(NamedParamContext ctx) {
  final Token name = ctx.ID().getSymbol();
  final SimpleReference reference = new SimpleReference(start(name), stop(name), name.getText());
  return new Argument(reference, start(ctx), stop(ctx), null, Modifiers.AccPublic);
}
 
開發者ID:JuliaComputing,項目名稱:JuliaDT,代碼行數:7,代碼來源:JuliaModuleFactory.java

示例6: visitAnonymousTypedParam

import org.eclipse.dltk.ast.Modifiers; //導入依賴的package包/類
@Override
public ASTNode visitAnonymousTypedParam(AnonymousTypedParamContext ctx) {
  SimpleReference type = (SimpleReference) visit(ctx.typeExpression());
  return new Argument(type, start(ctx), stop(ctx), null, Modifiers.AccPublic);
}
 
開發者ID:JuliaComputing,項目名稱:JuliaDT,代碼行數:6,代碼來源:JuliaModuleFactory.java

示例7: fillContentProvider

import org.eclipse.dltk.ast.Modifiers; //導入依賴的package包/類
protected void fillContentProvider(AbstractContentProvider provider,
        ItemsFilter itemsFilter, IProgressMonitor progressMonitor)
        throws CoreException {
    TypeItemsFilter typeSearchFilter = (TypeItemsFilter) itemsFilter;
    TypeSearchRequestor requestor = new TypeSearchRequestor(provider,
            typeSearchFilter);
    String typePattern = itemsFilter.getPattern();

    progressMonitor
            .setTaskName(DLTKUIMessages.FilteredTypesSelectionDialog_searchJob_taskName);

    IType[] types = new ModelAccess().findTypes(typePattern, ModelAccess
            .convertSearchRule(itemsFilter.getMatchRule()), 0,
            Modifiers.AccNameSpace, typeSearchFilter.getSearchScope(),
            progressMonitor);
    if (types != null) {
        for (IType type : types) {
            requestor.acceptTypeNameMatch(new DLTKSearchTypeNameMatch(type,
                    type.getFlags()));
        }
    } else {

        SearchEngine engine = new SearchEngine((WorkingCopyOwner) null);
        String packPattern = typeSearchFilter.getPackagePattern();

        /*
         * Setting the filter into match everything mode avoids filtering
         * twice by the same pattern (the search engine only provides
         * filtered matches). For the case when the pattern is a camel case
         * pattern with a terminator, the filter is not set to match
         * everything mode because jdt.core's SearchPattern does not support
         * that case.
         */
        int matchRule = typeSearchFilter.getMatchRule();
        if (matchRule == SearchPattern.RULE_CAMELCASE_MATCH) {
            // If the pattern is empty, the RULE_BLANK_MATCH will be chosen,
            // so
            // we don't have to check the pattern length
            char lastChar = typePattern.charAt(typePattern.length() - 1);

            if (lastChar == '<' || lastChar == ' ') {
                typePattern = typePattern.substring(0,
                        typePattern.length() - 1);
            } else {
                typeSearchFilter.setMatchEverythingMode(true);
            }
        } else {
            typeSearchFilter.setMatchEverythingMode(true);
        }

        try {
            engine.searchAllTypeNames(
                    packPattern == null ? null : packPattern.toCharArray(),
                    typeSearchFilter.getPackageFlags(),
                    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=176017
                    typePattern.toCharArray(),
                    matchRule,
                    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=176017
                    typeSearchFilter.getElementKind(), typeSearchFilter
                            .getSearchScope(), requestor,
                    IDLTKSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
                    progressMonitor);
        } finally {
            typeSearchFilter.setMatchEverythingMode(false);
        }
    }
}
 
開發者ID:UndefinedOffset,項目名稱:eclipse-silverstripedt,代碼行數:68,代碼來源:FilteredTypesSelectionDialog.java


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