当前位置: 首页>>代码示例>>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;未经允许,请勿转载。