Package com.igormaznitsa.jcp.directives
Class GlobalElseDirectiveHandler
- java.lang.Object
-
- com.igormaznitsa.jcp.directives.AbstractDirectiveHandler
-
- com.igormaznitsa.jcp.directives.GlobalElseDirectiveHandler
-
public class GlobalElseDirectiveHandler extends AbstractDirectiveHandler
The class implements the //#_else directive handler
-
-
Field Summary
-
Fields inherited from class com.igormaznitsa.jcp.directives.AbstractDirectiveHandler
DIRECTIVE_PREFIX, DIRECTIVES, GLOBAL_DIRECTIVES, ONE_LINE_COMMENT, PREFIX_FOR_KEEPING_LINES, PREFIX_FOR_KEEPING_LINES_PROCESSED_DIRECTIVES
-
-
Constructor Summary
Constructors Constructor Description GlobalElseDirectiveHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AfterDirectiveProcessingBehaviourexecute(java.lang.String string, PreprocessorContext context)Execute directivebooleanexecuteOnlyWhenExecutionAllowed()Shows that the directive can be executed only when the preprocessing n active state i.e.java.lang.StringgetName()Get the name of the directive without prefixjava.lang.StringgetReference()Get the directive reference, it will be printed for a help requestbooleanisGlobalPhaseAllowed()Shows that the directive can be executed during a global preprocessing phasebooleanisPreprocessingPhaseAllowed()Shows that the directive can be executed during the second preprocessing phase-
Methods inherited from class com.igormaznitsa.jcp.directives.AbstractDirectiveHandler
getArgumentType, getFullName, isDeprecated
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from class:AbstractDirectiveHandlerGet the name of the directive without prefix- Specified by:
getNamein classAbstractDirectiveHandler- Returns:
- the directive name, must not be null
-
getReference
public java.lang.String getReference()
Description copied from class:AbstractDirectiveHandlerGet the directive reference, it will be printed for a help request- Specified by:
getReferencein classAbstractDirectiveHandler- Returns:
- the directive reference as a String, must not be null
-
isGlobalPhaseAllowed
public boolean isGlobalPhaseAllowed()
Description copied from class:AbstractDirectiveHandlerShows that the directive can be executed during a global preprocessing phase- Overrides:
isGlobalPhaseAllowedin classAbstractDirectiveHandler- Returns:
- true if the directive allows the global directive phase, false if the directive must be ignored during that phase
-
isPreprocessingPhaseAllowed
public boolean isPreprocessingPhaseAllowed()
Description copied from class:AbstractDirectiveHandlerShows that the directive can be executed during the second preprocessing phase- Overrides:
isPreprocessingPhaseAllowedin classAbstractDirectiveHandler- Returns:
- true uf the directive can be executed during the second preprocessing phase else false if the directive must be ignored
-
execute
public AfterDirectiveProcessingBehaviour execute(java.lang.String string, PreprocessorContext context)
Description copied from class:AbstractDirectiveHandlerExecute directive- Specified by:
executein classAbstractDirectiveHandler- Parameters:
string- the tail of the string where the directive has been met, must not be null but can be emptycontext- the preprocessor context- Returns:
- the needed preprocessor behavior, must not be null
-
executeOnlyWhenExecutionAllowed
public boolean executeOnlyWhenExecutionAllowed()
Description copied from class:AbstractDirectiveHandlerShows that the directive can be executed only when the preprocessing n active state i.e. if it is in active block //#if..//#endif of //#while- Overrides:
executeOnlyWhenExecutionAllowedin classAbstractDirectiveHandler- Returns:
- true if the directive can be executed only if it is in active block, else the directive will be called in any case
-
-