Class AbstractActionManager
- java.lang.Object
-
- org.apache.pdfbox.preflight.action.AbstractActionManager
-
- Direct Known Subclasses:
GoToAction,HideAction,InvalidAction,NamedAction,SubmitAction,ThreadAction,UndefAction,UriAction
public abstract class AbstractActionManager extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringaaKeyAction name in a Additional Action dictionaryprotected COSDictionaryactionDictionaryThe action dictionary checked by this classprivate ActionManagerFactoryactionFactActionManager factory used to create new ActionManagerprotected PreflightContextcontextThe validation context
-
Constructor Summary
Constructors Constructor Description AbstractActionManager(ActionManagerFactory amFact, COSDictionary adict, PreflightContext ctx, java.lang.String aaKey)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description COSDictionarygetActionDictionary()java.lang.StringgetAdditionalActionKey()protected abstract booleaninnerValid()This method must be implemented by inherited classes to process specific validation.booleanisAdditionalAction()booleanvalid()Call thevalid(boolean)method with the additionalActionAuth set to false.booleanvalid(boolean additionalActionAuth)Validate an Action dictionary.protected booleanvalidNextActions()This method create a list of Action Managers which represent actions in the Next entry of the current action dictionary.
-
-
-
Field Detail
-
actionFact
private ActionManagerFactory actionFact
ActionManager factory used to create new ActionManager
-
aaKey
private java.lang.String aaKey
Action name in a Additional Action dictionary
-
actionDictionary
protected COSDictionary actionDictionary
The action dictionary checked by this class
-
context
protected PreflightContext context
The validation context
-
-
Constructor Detail
-
AbstractActionManager
AbstractActionManager(ActionManagerFactory amFact, COSDictionary adict, PreflightContext ctx, java.lang.String aaKey)
- Parameters:
amFact- Instance of ActionManagerFactory used to create ActionManager to check Next actions.adict- the COSDictionary of the action wrapped by this class.ctx- the validation context .aaKey- The name of the key which identify the action in a additional action dictionary.
-
-
Method Detail
-
isAdditionalAction
public boolean isAdditionalAction()
- Returns:
- the isAdditionalAction
-
getActionDictionary
public COSDictionary getActionDictionary()
- Returns:
- the actionDictionary
-
getAdditionalActionKey
public java.lang.String getAdditionalActionKey()
- Returns:
- the aaKey
-
validNextActions
protected boolean validNextActions() throws ValidationExceptionThis method create a list of Action Managers which represent actions in the Next entry of the current action dictionary. For each Next Action, the innerValid is called and the method returns false if a validation fails.- Returns:
- True if all Next Action are valid, false otherwise.
- Throws:
ValidationException
-
valid
public boolean valid() throws ValidationExceptionCall thevalid(boolean)method with the additionalActionAuth set to false.- Returns:
- the validation state.
- Throws:
ValidationException
-
valid
public boolean valid(boolean additionalActionAuth) throws ValidationExceptionValidate an Action dictionary. Return false if the dictionary is invalid (ex : missing key). If the ActionManager represents an AdditionalAction, this method returns false and updates the error list when the additionalActionAuth parameter is set to false. This method call the innerValid method to process specific checks according to the action type. If innerValid successes, all actions contained in the Next entry of the Action dictionary are validated.- Parameters:
additionalActionAuth- boolean to know if an additional action is authorized.- Returns:
- the validation state of the Action dictionary.
- Throws:
ValidationException
-
innerValid
protected abstract boolean innerValid() throws ValidationExceptionThis method must be implemented by inherited classes to process specific validation.- Returns:
- True if the action is valid, false otherwise.
- Throws:
ValidationException
-
-