本文整理汇总了Java中com.siyeh.ig.psiutils.SerializationUtils.isExternalizable方法的典型用法代码示例。如果您正苦于以下问题:Java SerializationUtils.isExternalizable方法的具体用法?Java SerializationUtils.isExternalizable怎么用?Java SerializationUtils.isExternalizable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.siyeh.ig.psiutils.SerializationUtils
的用法示例。
在下文中一共展示了SerializationUtils.isExternalizable方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitClass
import com.siyeh.ig.psiutils.SerializationUtils; //导入方法依赖的package包/类
@Override
public void visitClass(@NotNull PsiClass aClass) {
// no call to super, so it doesn't drill down
if (aClass.isInterface() || aClass.isAnnotationType()) {
return;
}
if (!SerializationUtils.isExternalizable(aClass)) {
return;
}
final boolean hasReadObject =
SerializationUtils.hasReadObject(aClass);
final boolean hasWriteObject =
SerializationUtils.hasWriteObject(aClass);
if (!hasWriteObject && !hasReadObject) {
return;
}
registerClassError(aClass, Boolean.valueOf(hasReadObject),
Boolean.valueOf(hasWriteObject));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ExternalizableWithSerializationMethodsInspection.java
示例2: visitMethod
import com.siyeh.ig.psiutils.SerializationUtils; //导入方法依赖的package包/类
@Override
public void visitMethod(PsiMethod method) {
super.visitMethod(method);
if (!method.isConstructor()) {
return;
}
if (!method.hasModifierProperty(PsiModifier.PUBLIC)) {
return;
}
final PsiClass aClass = method.getContainingClass();
if (aClass == null || aClass.hasModifierProperty(PsiModifier.ABSTRACT)) {
return;
}
if (SerializationUtils.isExternalizable(aClass)) {
final PsiParameterList parameterList = method.getParameterList();
if (parameterList.getParametersCount() == 0) {
return;
}
}
registerMethodError(method, Boolean.FALSE);
}
示例3: visitClass
import com.siyeh.ig.psiutils.SerializationUtils; //导入方法依赖的package包/类
@Override
public void visitClass(PsiClass aClass) {
super.visitClass(aClass);
if (aClass.isInterface() || aClass.isEnum()) {
return;
}
if (!aClass.hasModifierProperty(PsiModifier.PUBLIC) || aClass.hasModifierProperty(PsiModifier.ABSTRACT)) {
return;
}
final PsiMethod[] constructors = aClass.getConstructors();
if (constructors.length > 0) {
return;
}
if (SerializationUtils.isExternalizable(aClass)) {
return;
}
registerClassError(aClass, Boolean.TRUE);
}
示例4: visitMethod
import com.siyeh.ig.psiutils.SerializationUtils; //导入方法依赖的package包/类
@Override
public void visitMethod(@NotNull PsiMethod method) {
//no call to super, so we don't drill into anonymous classes
if (!method.isConstructor()) {
return;
}
if (!method.hasModifierProperty(PsiModifier.PUBLIC)) {
return;
}
final PsiClass containingClass = method.getContainingClass();
if (containingClass == null) {
return;
}
if (containingClass.hasModifierProperty(PsiModifier.PUBLIC) ||
containingClass.hasModifierProperty(PsiModifier.PROTECTED)) {
return;
}
if (SerializationUtils.isExternalizable(containingClass)) {
final PsiParameterList parameterList = method.getParameterList();
if (parameterList.getParametersCount() == 0) {
return;
}
}
registerModifierError(PsiModifier.PUBLIC, method, method);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:PublicConstructorInNonPublicClassInspection.java
示例5: visitClass
import com.siyeh.ig.psiutils.SerializationUtils; //导入方法依赖的package包/类
@Override
public void visitClass(PsiClass aClass)
{
super.visitClass(aClass);
if(aClass.isInterface() || aClass.isEnum())
{
return;
}
if(!aClass.hasModifierProperty(PsiModifier.PUBLIC) || aClass.hasModifierProperty(PsiModifier.ABSTRACT))
{
return;
}
final PsiMethod[] constructors = aClass.getConstructors();
if(constructors.length > 0)
{
return;
}
if(SerializationUtils.isExternalizable(aClass))
{
return;
}
registerClassError(aClass, Boolean.TRUE);
}
示例6: visitMethod
import com.siyeh.ig.psiutils.SerializationUtils; //导入方法依赖的package包/类
@Override
public void visitMethod(PsiMethod method)
{
super.visitMethod(method);
if(!method.isConstructor())
{
return;
}
if(!method.hasModifierProperty(PsiModifier.PUBLIC))
{
return;
}
final PsiClass aClass = method.getContainingClass();
if(aClass == null || aClass.hasModifierProperty(PsiModifier.ABSTRACT))
{
return;
}
if(SerializationUtils.isExternalizable(aClass))
{
final PsiParameterList parameterList = method.getParameterList();
if(parameterList.getParametersCount() == 0)
{
return;
}
}
registerMethodError(method, Boolean.FALSE);
}