Package com.helger.photon.ajax.decl
Class AjaxFunctionDeclaration
- java.lang.Object
-
- com.helger.photon.ajax.decl.AjaxFunctionDeclaration
-
- All Implemented Interfaces:
com.helger.commons.name.IHasName,IAjaxFunctionDeclaration
@Immutable public class AjaxFunctionDeclaration extends Object implements IAjaxFunctionDeclaration
Abstract base implementation ofIAjaxFunctionDeclaration- Author:
- Philip Helger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAjaxFunctionDeclaration.BuilderBuilder forAjaxFunctionDeclarationobjects.
-
Constructor Summary
Constructors Constructor Description AjaxFunctionDeclaration(String sFunctionName, Supplier<? extends IAjaxExecutor> aExecutorFactory, Predicate<? super com.helger.web.scope.IRequestWebScopeWithoutResponse> aExecutionFilter, String sServletPath)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AjaxFunctionDeclaration.Builderbuilder()Create a function that is not named.static AjaxFunctionDeclaration.Builderbuilder(String sFunctionName)booleancanExecute(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope)Check if this AJAX function can be executed for the passed request.StringgetAjaxServletPath()Predicate<? super com.helger.web.scope.IRequestWebScopeWithoutResponse>getExecutionFilter()Supplier<? extends IAjaxExecutor>getExecutorFactory()StringgetName()static intgetUniqueFunctionID()StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.photon.ajax.decl.IAjaxFunctionDeclaration
getExecutor, getInvocationURI, getInvocationURI, getInvocationURL, getPathWithoutContext
-
-
-
-
Method Detail
-
getName
@Nonnull @Nonempty public final String getName()
- Specified by:
getNamein interfacecom.helger.commons.name.IHasName
-
getExecutorFactory
@Nonnull public final Supplier<? extends IAjaxExecutor> getExecutorFactory()
- Specified by:
getExecutorFactoryin interfaceIAjaxFunctionDeclaration- Returns:
- The executor factory to be used. May not be
null.
-
getExecutionFilter
@Nullable public final Predicate<? super com.helger.web.scope.IRequestWebScopeWithoutResponse> getExecutionFilter()
- Specified by:
getExecutionFilterin interfaceIAjaxFunctionDeclaration- Returns:
- The optional filter to be invoked before the main AJAX invocation.
May be
null.
-
canExecute
public boolean canExecute(@Nonnull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope)
Description copied from interface:IAjaxFunctionDeclarationCheck if this AJAX function can be executed for the passed request.- Specified by:
canExecutein interfaceIAjaxFunctionDeclaration- Parameters:
aRequestScope- The request scope to be used for evaluation. Nevernull.- Returns:
trueif this AJAX function can be executed,falseotherwise.
-
getAjaxServletPath
@Nonnull @Nonempty public String getAjaxServletPath()
- Specified by:
getAjaxServletPathin interfaceIAjaxFunctionDeclaration- Returns:
- The path to the AJAX servlet. Must start with a slash and end with a slash!
-
builder
@Nonnull public static AjaxFunctionDeclaration.Builder builder()
Create a function that is not named. The created name is ensured to be unique. The registration is removed once the global context is shutdown so the created path is not durable, as the next time the context is initialized a different number might be assigned. Usebuilder(String)for a permanent name.- Returns:
- A new function declaration builder. Never
null. - See Also:
builder(String)
-
getUniqueFunctionID
public static int getUniqueFunctionID()
-
builder
@Nonnull public static AjaxFunctionDeclaration.Builder builder(@Nullable String sFunctionName)
-
-