Java Code Examples for net.bytebuddy.description.type.TypeDescription#isSamePackage()

The following examples show how to use net.bytebuddy.description.type.TypeDescription#isSamePackage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FieldDescription.java    From byte-buddy with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public boolean isVisibleTo(TypeDescription typeDescription) {
    return getDeclaringType().asErasure().isVisibleTo(typeDescription)
            && (isPublic()
            || typeDescription.equals(getDeclaringType().asErasure())
            || isProtected() && getDeclaringType().asErasure().isAssignableFrom(typeDescription)
            || !isPrivate() && typeDescription.isSamePackage(getDeclaringType().asErasure())
            || isPrivate() && typeDescription.isNestMateOf(getDeclaringType().asErasure()));
}
 
Example 2
Source File: FieldDescription.java    From byte-buddy with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public boolean isAccessibleTo(TypeDescription typeDescription) {
    return isPublic()
            || typeDescription.equals(getDeclaringType().asErasure())
            || !isPrivate() && typeDescription.isSamePackage(getDeclaringType().asErasure())
            || isPrivate() && typeDescription.isNestMateOf(getDeclaringType().asErasure());
}
 
Example 3
Source File: MethodDescription.java    From byte-buddy with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public boolean isVisibleTo(TypeDescription typeDescription) {
    return (isVirtual() || getDeclaringType().asErasure().isVisibleTo(typeDescription))
            && (isPublic()
            || typeDescription.equals(getDeclaringType().asErasure())
            || isProtected() && getDeclaringType().asErasure().isAssignableFrom(typeDescription)
            || !isPrivate() && typeDescription.isSamePackage(getDeclaringType().asErasure())
            || isPrivate() && typeDescription.isNestMateOf(getDeclaringType().asErasure()));
}
 
Example 4
Source File: MethodDescription.java    From byte-buddy with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public boolean isAccessibleTo(TypeDescription typeDescription) {
    return (isVirtual() || getDeclaringType().asErasure().isVisibleTo(typeDescription))
            && (isPublic()
            || typeDescription.equals(getDeclaringType().asErasure())
            || !isPrivate() && typeDescription.isSamePackage(getDeclaringType().asErasure()))
            || isPrivate() && typeDescription.isNestMateOf(getDeclaringType().asErasure());
}