All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.asciidoctor.extension.PositionalAttributes Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package org.asciidoctor.extension;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Defines the on which attributes the first, second, etc attribute of a macro is mapped.
 * 

Example: For this inline macro that defines {@code section} as the first positional parameter: *

 * @PositionalAttribute("section")
 * @('man')
 * public class ManPageMacroProcessor extends InlineMacroProcessor {
 *     public ManPageMacroProcessor(String macroName) {
 *         super(macroName)
 *     }
 *
 *     public Object process(StructuralNode parent, String target, Map attributes) {
 *         assertEquals(attributes.get("section"), "7")
 *     }
 * }
 * 
 * 
* * this macro invocation will pass {@code "7"} as value for the attribute {@code section}: * * {@code man:gittutorial[7]} *

Applicable for: *

* * * * * * * * * *
BlockMacroProcessor
BlockProcessor
BlockProcessor
DocInfoProcessor
IncludeProcessor
InlineMacroProcessor
Postprocessor
Preprocessor
Treeprocessor
*/ @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface PositionalAttributes { String[] value(); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy