• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Modifier类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.netbeans.modules.csl.api.Modifier的典型用法代码示例。如果您正苦于以下问题:Java Modifier类的具体用法?Java Modifier怎么用?Java Modifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Modifier类属于org.netbeans.modules.csl.api包,在下文中一共展示了Modifier类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getIconName

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
private static String getIconName(String typeName, String extension, Collection<Modifier> modifiers) {

        StringBuffer fileName = new StringBuffer( typeName );

        if (modifiers.contains(Modifier.STATIC)) {
            fileName.append( "Static" );
        }
        if (modifiers.contains(Modifier.PROTECTED)) {
            return fileName.append( "Protected" ).append( extension ).toString();
        }
        if (modifiers.contains(Modifier.PRIVATE)) {
            return fileName.append( "Private" ).append( extension ).toString();
        }
        // Assume it's public
        return fileName.append( "Public" ).append( extension ).toString();
        //return fileName.append( "Package" ).append( extension ).toString();
        //return fileName.append(extension).toString();
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:Icons.java


示例2: ProposalItem

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
public ProposalItem(String typeProposal, String name, String type, String description, int anchorOffset) {
        this.anchorOffset = anchorOffset;
        this.elementeKind = elementeKindMap.get(typeProposal);
        this.name = name.replaceAll("&lt;", "<").replaceAll("&gt;", ">");
        this.proposalType = proposalTypeMap.get(typeProposal);
        this.type = type;
        
//        if(typeProposal.equals("constructor")) {
//            this.type = "";
//        } else {
//            this.type = type;
//            this.proposalType = ProposalType.METHOD_PUBLIC;
//        }
        this.description = description;
        modifiers = new HashSet<Modifier>();
    }
 
开发者ID:fundacionjala,项目名称:oblivion-netbeans-plugin,代码行数:17,代码来源:ProposalItem.java


示例3: toModifier

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
protected static Set<Modifier> toModifier(int modifier) {
    Set<Modifier> modifiers = new HashSet<>();
    if (isStatic(modifier)) {
        modifiers.add(Modifier.STATIC);
    }
    if (isAbstract(modifier)) {
        modifiers.add(Modifier.ABSTRACT);
    }
    if (isPrivate(modifier)) {
        modifiers.add(Modifier.PRIVATE);
    }
    if (isProtected(modifier)) {
        modifiers.add(Modifier.PROTECTED);
    }
    if (isPublic(modifier)) {
        modifiers.add(Modifier.PUBLIC);
    }
    return modifiers;
}
 
开发者ID:golo-lang,项目名称:golo-netbeans,代码行数:20,代码来源:SimpleGoloElementHandle.java


示例4: handleModifiers

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
private void handleModifiers(FanStructureItem item, List<FanAstScopeVarBase.ModifEnum> modifs)
{
	for (FanAstScopeVarBase.ModifEnum modif : modifs)
	{
		if (modif == ModifEnum.STATIC)
		{
			item.addModifier(Modifier.STATIC);
		} else if (modif == ModifEnum.PRIVATE)
		{
			item.addModifier(Modifier.PRIVATE);
		} else if (modif == ModifEnum.PUBLIC)
		{
			item.addModifier(Modifier.PUBLIC);
		} else if (modif == ModifEnum.PROTECTED)
		{
			item.addModifier(Modifier.PROTECTED);
		}
	}
}
 
开发者ID:tcolar,项目名称:fantomidemodule,代码行数:20,代码来源:FanStructureAnalyzer.java


示例5: getPorposalsAfterDot

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
private Collection<? extends ProposalItem> getPorposalsAfterDot(Collection<? extends ProposalItem> items) {
    Iterator<? extends ProposalItem> it = items.iterator();
    while (it.hasNext()) {
        ProposalItem item = it.next();
        if (item.isConstructor() || item.isModifier(Modifier.STATIC)) {
            it.remove();
        }
    }
    return items;
}
 
开发者ID:fundacionjala,项目名称:oblivion-netbeans-plugin,代码行数:11,代码来源:AutoCompleteHandler.java


示例6: getStaticProposals

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
private Collection<? extends ProposalItem> getStaticProposals(Collection<? extends ProposalItem> items) {
    Iterator<? extends ProposalItem> it = items.iterator();
    while (it.hasNext()) {
        ProposalItem item = it.next();
        if (!item.isModifier(Modifier.STATIC) || !item.isModifier(Modifier.PUBLIC)) {
            it.remove();
        }
    }
    return items;
}
 
开发者ID:fundacionjala,项目名称:oblivion-netbeans-plugin,代码行数:11,代码来源:AutoCompleteHandler.java


示例7: getPublicConstructors

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
private Collection<? extends ProposalItem> getPublicConstructors(Collection<? extends ProposalItem> items) {
    Iterator<? extends ProposalItem> it = items.iterator();
    while (it.hasNext()) {
        ProposalItem item = it.next();
        if (!item.isConstructor() || !item.isModifier(Modifier.PUBLIC)) {
            it.remove();
        }
    }
    return items;
}
 
开发者ID:fundacionjala,项目名称:oblivion-netbeans-plugin,代码行数:11,代码来源:AutoCompleteHandler.java


示例8: ProposalItem

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
public ProposalItem(String name, String type, String icon, int anchorOffset) {
    this.anchorOffset = anchorOffset;
    this.name = name;
    this.type = type;
    this.icon = icon;
    modifiers = new HashSet<Modifier>();
}
 
开发者ID:fundacionjala,项目名称:oblivion-netbeans-plugin,代码行数:8,代码来源:ProposalItem.java


示例9: IsInAttributeDeclaration

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
private boolean IsInAttributeDeclaration(VariableTreeImpl attribute, Tree parent, String className) {
    if (attribute.getName() != null && attribute.getType() != null) {
        this.collectionOfDeclarations.get(className).attributes.add(attribute);
        Set<Modifier> modifiersAdapter = modifiersAdapter(attribute.getModifiers());
        this.collectionOfDeclarations.get(className).item_attributes.add(new AttributeItem(attribute.getName().toString(), attribute.getType().toString(), offset, modifiersAdapter(attribute.getModifiers())));
    }
    return false;
}
 
开发者ID:fundacionjala,项目名称:oblivion-netbeans-plugin,代码行数:9,代码来源:RecoverDeclarations.java


示例10: modifiersAdapter

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
/**
 * method to cast from Set< javax.lang.model.element.Modifier> to
 * Set< org.netbeans.modules.csl.api.Modifier>
 *
 * @param modifiersFromTree
 * @return a set<org.netbeans.modules.csl.api.Modifier>
 */
public static Set<org.netbeans.modules.csl.api.Modifier> modifiersAdapter(ModifiersTree modifiers) {
    Set<org.netbeans.modules.csl.api.Modifier> transformed = new HashSet<>();
    if (modifiers != null) {
        Set<javax.lang.model.element.Modifier> modifiersFromTree = modifiers.getFlags();
        for (javax.lang.model.element.Modifier modifierFromTree : modifiersFromTree) {
            if (MAP_MODIFIER.containsKey(modifierFromTree)) {
                transformed.add(MAP_MODIFIER.get(modifierFromTree));
            }
        }
    }
    return transformed;
}
 
开发者ID:fundacionjala,项目名称:oblivion-netbeans-plugin,代码行数:20,代码来源:RecoverDeclarations.java


示例11: getModifiers

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
@Override
public Set<Modifier> getModifiers() {
    if (CharSequenceUtilities.startsWith(item.getDescription(), "*")) {
        return Collections.singleton(Modifier.STATIC);
    }
    return Collections.emptySet();
}
 
开发者ID:guru-digital,项目名称:sstemplate-netbeans,代码行数:8,代码来源:SSTemplateStructureItem.java


示例12: getModifiers

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
@Override
public Set<Modifier> getModifiers() {
    Set<Modifier> modifiers = new HashSet<>();
    switch (goloFunction.getVisibility()) {
        case LOCAL: modifiers.add(Modifier.PRIVATE);
            break;
        case PUBLIC: modifiers.add(Modifier.PUBLIC);
            break;
        default: break;
    }
    return modifiers;
}
 
开发者ID:golo-lang,项目名称:golo-netbeans,代码行数:13,代码来源:GoloFunctionElementHandle.java


示例13: SimpleGoloElementHandle

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
public SimpleGoloElementHandle(FileObject fileObject, String fromClassName, String elementName, ElementKind elementKind, Set<Modifier> modifiers) {
    this.fileObject = fileObject;
    this.elementName = elementName;
    this.modifiers = modifiers;
    this.elementKind = elementKind;
    this.fromClassName = fromClassName;
}
 
开发者ID:golo-lang,项目名称:golo-netbeans,代码行数:8,代码来源:SimpleGoloElementHandle.java


示例14: getModifiers

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
@Override
public Set<Modifier> getModifiers() {
  Set<Modifier> modifiers = new HashSet<>();
  ASTFunctionDeclaration decl = (ASTFunctionDeclaration) node;
  if (decl.isLocal()) {
    modifiers.add(Modifier.PRIVATE);
  }
  else {
    modifiers.add(Modifier.PUBLIC);
  }
  return modifiers;
}
 
开发者ID:golo-lang,项目名称:golo-netbeans,代码行数:13,代码来源:FunctionElementHandle.java


示例15: getModifiers

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
@Override
public Set<Modifier> getModifiers() {
    Set<Modifier> modifiers = new HashSet<>();
    switch (function.getVisibility()) {
        case LOCAL:
            modifiers.add(Modifier.PRIVATE);
        case PUBLIC:
            modifiers.add(Modifier.PUBLIC);
        default:
            break;
    }
    return modifiers;
}
 
开发者ID:golo-lang,项目名称:golo-netbeans,代码行数:14,代码来源:CompletionItem.java


示例16: getIcon

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
@Override
public ImageIcon getIcon() {
    if (isGoloElement) {
        return super.getIcon();
    }

    Set<Modifier> modifiers = importedField.getModifiers();
    if (modifiers.contains(Modifier.STATIC)) {
        return new ImageIcon(ImageUtilities.loadImage(JAVA_STATIC_FIELD_ICON));
    }
    return new ImageIcon(ImageUtilities.loadImage(JAVA_FIELD_ICON));
}
 
开发者ID:golo-lang,项目名称:golo-netbeans,代码行数:13,代码来源:CompletionItem.java


示例17: getModifiers

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
@Override
public Set<Modifier> getModifiers() {
    return Collections.emptySet();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:Command.java


示例18: getElementIcon

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
public static ImageIcon getElementIcon( ElementKind elementKind, Collection<Modifier> modifiers ) {

    if ( modifiers == null ) {
        modifiers = Collections.<Modifier>emptyList();
    }

    Image img = null;

    switch( elementKind ) {
    case FILE:
        img = ImageUtilities.loadImage( ICON_BASE + "emptyfile-icon" + PNG_EXTENSION );
        break;
    case ERROR:
        img = ImageUtilities.loadImage( ICON_BASE + "error-glyph" + GIF_EXTENSION );
        break;
    case PACKAGE:
    case MODULE:
        img = ImageUtilities.loadImage( ICON_BASE + "package" + GIF_EXTENSION );
        break;
    case TEST:
        img = ImageUtilities.loadImage( ICON_BASE + "test" + PNG_EXTENSION );
        break;
    case CLASS:
    case INTERFACE:
        img = ImageUtilities.loadImage( ICON_BASE + "class" + PNG_EXTENSION );
        break;
    case TAG:
        img = ImageUtilities.loadImage( ICON_BASE + "html_element" + PNG_EXTENSION );
        break;
    case RULE:
        img = ImageUtilities.loadImage( ICON_BASE + "rule" + PNG_EXTENSION );
        break;
    case VARIABLE:
    case PROPERTY:
    case GLOBAL:
    case ATTRIBUTE:
    case FIELD:
        img = ImageUtilities.loadImage( getIconName( ICON_BASE + "field", PNG_EXTENSION, modifiers ) );
        break;
    case PARAMETER:
    case CONSTANT:
        img = ImageUtilities.loadImage(getIconName(ICON_BASE + "constant", PNG_EXTENSION, modifiers)); // NOI18N
        if (img == null) {
            img = ImageUtilities.loadImage(ICON_BASE + "constantPublic" + PNG_EXTENSION); // NOI18N
        }
        break;
    case CONSTRUCTOR:
        img = ImageUtilities.loadImage( getIconName( ICON_BASE + "constructor", PNG_EXTENSION, modifiers ) );
        break;
    case METHOD:
        img = ImageUtilities.loadImage( getIconName( ICON_BASE + "method", PNG_EXTENSION, modifiers ) );
        break;
    case DB:
        img = ImageUtilities.loadImage(ICON_BASE + "database" + GIF_EXTENSION);
        break;
    default:   
            img = null;
    }

    return img == null ? null : new ImageIcon (img);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:62,代码来源:Icons.java


示例19: getModifiers

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
public Set<Modifier> getModifiers() {
    return Collections.emptySet();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:ElementScanningTask.java


示例20: filter

import org.netbeans.modules.csl.api.Modifier; //导入依赖的package包/类
public Collection<StructureItem> filter(List<StructureItem> original) {
        boolean non_public = filters.isSelected(SHOW_NON_PUBLIC);
        boolean statik = filters.isSelected(SHOW_STATIC);
        boolean fields = filters.isSelected(SHOW_FIELDS);
        // XXX Enable later boolean inherited = filters.isSelected(SHOW_INHERITED);
        
        if (original == null || original.isEmpty()) {
            return Collections.EMPTY_LIST;
        }

        List<StructureItem> result = new ArrayList<StructureItem>(original.size());
      
        if (!disableFiltering) {
            for (StructureItem description : original) {

                // I default no access modifier to mean public, unlike the Java version where it means package protected
                if (!non_public &&
                        (description.getModifiers().contains(Modifier.PROTECTED) || description.getModifiers().contains(Modifier.PRIVATE))) {
//            if ( !non_public && 
//                 !description.getModifiers().contains(Modifier.PUBLIC)                 
//                 /* Fix for #89777 && !description.modifiers.contains(Modifier.PROTECTED) */ ) {
                    continue;
                }

                if (!statik && description.getModifiers().contains(Modifier.STATIC)) {
                    continue;
                }

                if (!fields && (description.getKind() == ElementKind.FIELD || (description.getKind() == ElementKind.ATTRIBUTE))) {
                    continue;
                }

                // XXX Inherited members

                result.add(description);
            }
        } else {
            result.addAll(original);
        }

        Collections.sort(result, isNaturalSort() ? Description.POSITION_COMPARATOR : Description.ALPHA_COMPARATOR);

        return result;
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:45,代码来源:ClassMemberFilters.java



注:本文中的org.netbeans.modules.csl.api.Modifier类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XMLUtils类代码示例发布时间:2022-05-23
下一篇:
Java DenseVector类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap