Class TargetResolverImpl
- java.lang.Object
-
- com.atlassian.confluence.internal.permissions.TargetResolverImpl
-
- All Implemented Interfaces:
TargetResolver
public class TargetResolverImpl extends Object implements TargetResolver
-
-
Constructor Summary
Constructors Constructor Description TargetResolverImpl(AnyTypeDao anyTypeDao)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isContainerTarget(Target target)
Returns true if object is aTarget
for a container being used to check operations on a different childTargetType
within it.<T> @NonNull com.atlassian.fugue.Option<T>
resolveContainerHibernateObject(Target target, Class<T> expectedType)
Get the target hibernate object for the container relating to the specified target.<T> @NonNull com.atlassian.fugue.Option<T>
resolveHibernateObject(Target target, Class<T> expectedType)
Get the target hibernate object, if this target is one that has a specific object (not a container)<T> @NonNull T
resolveModelObject(Target target, Class<T> expectedClass)
Get the target model object (e.g.
-
-
-
Constructor Detail
-
TargetResolverImpl
public TargetResolverImpl(AnyTypeDao anyTypeDao)
-
-
Method Detail
-
resolveModelObject
public <T> @NonNull T resolveModelObject(Target target, Class<T> expectedClass)
Description copied from interface:TargetResolver
Get the target model object (e.g. Content), if this target is one that has a specific model object (not a container)- Specified by:
resolveModelObject
in interfaceTargetResolver
- Type Parameters:
T
- the class type to cast the model object to after resolving the target to a model object- Returns:
- the result of resolving the model object, cast to T
-
resolveHibernateObject
public <T> @NonNull com.atlassian.fugue.Option<T> resolveHibernateObject(Target target, Class<T> expectedType)
Description copied from interface:TargetResolver
Get the target hibernate object, if this target is one that has a specific object (not a container)- Specified by:
resolveHibernateObject
in interfaceTargetResolver
- Parameters:
expectedType
- hibernate object type to cast to, likely Class extends ConfluenceEntityObject>,- Returns:
- an option containing the hibernate object, or an empty option if the types are correct but the hibernate ID doesn't exist in the database
- See Also:
TargetResolver.resolveContainerHibernateObject(com.atlassian.confluence.api.model.permissions.Target, Class)
-
resolveContainerHibernateObject
public <T> @NonNull com.atlassian.fugue.Option<T> resolveContainerHibernateObject(Target target, Class<T> expectedType)
Description copied from interface:TargetResolver
Get the target hibernate object for the container relating to the specified target.- If this target is a container target, get that container's hibernate object.
- If this target is one that has a specific object (not a container), get that object's container's hibernate object.
- Specified by:
resolveContainerHibernateObject
in interfaceTargetResolver
- Parameters:
expectedType
- hibernate object type to cast to, likely Class extends ConfluenceEntityObject>,- Returns:
- an option containing the hibernate object, or an empty option if the types are correct but the hibernate ID doesn't exist in the database
- See Also:
TargetResolver.resolveHibernateObject(com.atlassian.confluence.api.model.permissions.Target, Class)
-
isContainerTarget
public boolean isContainerTarget(Target target)
Description copied from interface:TargetResolver
Returns true if object is aTarget
for a container being used to check operations on a different childTargetType
within it.- Specified by:
isContainerTarget
in interfaceTargetResolver
- Returns:
- true if it's a container target, false otherwise
- See Also:
Target.forChildrenOfContainer(com.atlassian.confluence.api.model.content.Container, com.atlassian.confluence.api.model.permissions.TargetType)
-
-