本文整理汇总了Java中com.puppycrawl.tools.checkstyle.api.Scope.PRIVATE属性的典型用法代码示例。如果您正苦于以下问题:Java Scope.PRIVATE属性的具体用法?Java Scope.PRIVATE怎么用?Java Scope.PRIVATE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.puppycrawl.tools.checkstyle.api.Scope
的用法示例。
在下文中一共展示了Scope.PRIVATE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: equalScope
/**
* Tests whether the scope of a field or method is compatible
* with the scope of this check. References for compatible
* fields or methods should be checked.
* @param aFieldOrMethod the field or method to check.
* @return true if the scope of aFieldOrMethod is compatible
* with the scope of this check.
*/
private boolean equalScope(FieldOrMethod aFieldOrMethod)
{
if (aFieldOrMethod.isPrivate()) {
return (mScope == Scope.PRIVATE);
}
else if (aFieldOrMethod.isProtected()) {
return (mScope == Scope.PROTECTED);
}
else if (aFieldOrMethod.isPublic()) {
return (mScope == Scope.PUBLIC);
}
else {
return (mScope == Scope.PACKAGE);
}
}
示例2: getScopeFromMods
/**
* Returns the Scope specified by the modifier set.
*
* @param aMods root node of a modifier set
* @return a {@code Scope} value
*/
public static Scope getScopeFromMods(DetailAST aMods) {
// default scope
Scope returnValue = Scope.PACKAGE;
for (AST token = aMods.getFirstChild(); token != null
&& returnValue == Scope.PACKAGE;
token = token.getNextSibling()) {
if ("public".equals(token.getText())) {
returnValue = Scope.PUBLIC;
}
else if ("protected".equals(token.getText())) {
returnValue = Scope.PROTECTED;
}
else if ("private".equals(token.getText())) {
returnValue = Scope.PRIVATE;
}
}
return returnValue;
}
示例3: mustCheckReferenceCount
/** @see com.puppycrawl.tools.checkstyle.checks.usage.AbstractUsageCheck */
public boolean mustCheckReferenceCount(DetailAST aAST)
{
final DetailAST mods = aAST.findFirstToken(TokenTypes.MODIFIERS);
return ((mods != null)
&& (ScopeUtils.getScopeFromMods(mods) == Scope.PRIVATE));
}
示例4: mustCheckReferenceCount
/** @see com.puppycrawl.tools.checkstyle.checks.usage.AbstractUsageCheck */
public boolean mustCheckReferenceCount(DetailAST aAST)
{
final DetailAST mods = aAST.findFirstToken(TokenTypes.MODIFIERS);
if ((mods == null)
|| (ScopeUtils.getScopeFromMods(mods) != Scope.PRIVATE))
{
return false;
}
return !mAllowSerializationMethods
|| !(isWriteObject(aAST) || isReadObject(aAST)
|| isWriteReplaceOrReadResolve(aAST));
}