Package com.igormaznitsa.jcp.directives
Class DefineDirectiveHandler
- java.lang.Object
-
- com.igormaznitsa.jcp.directives.AbstractDirectiveHandler
-
- com.igormaznitsa.jcp.directives.DefineDirectiveHandler
-
- Direct Known Subclasses:
DefinelDirectiveHandler,UndefDirectiveHandler
public class DefineDirectiveHandler extends AbstractDirectiveHandler
The class implements the //#define 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 DefineDirectiveHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AfterDirectiveProcessingBehaviourexecute(java.lang.String rawTail, PreprocessorContext context)Execute directiveDirectiveArgumentTypegetArgumentType()Get the argument type needed by the directivejava.lang.StringgetName()Get the name of the directive without prefixjava.lang.StringgetReference()Get the directive reference, it will be printed for a help requestprotected voidprocess(PreprocessorContext context, java.lang.String varName, Value value, boolean exists)-
Methods inherited from class com.igormaznitsa.jcp.directives.AbstractDirectiveHandler
executeOnlyWhenExecutionAllowed, getFullName, isDeprecated, isGlobalPhaseAllowed, isPreprocessingPhaseAllowed
-
-
-
-
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
-
getArgumentType
public DirectiveArgumentType getArgumentType()
Description copied from class:AbstractDirectiveHandlerGet the argument type needed by the directive- Overrides:
getArgumentTypein classAbstractDirectiveHandler- Returns:
- the argument type needed by the directive, it can't 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
-
process
protected void process(PreprocessorContext context, java.lang.String varName, Value value, boolean exists)
-
execute
public AfterDirectiveProcessingBehaviour execute(java.lang.String rawTail, PreprocessorContext context)
Description copied from class:AbstractDirectiveHandlerExecute directive- Specified by:
executein classAbstractDirectiveHandler- Parameters:
rawTail- 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
-
-