org.asciidoctor.extension.PositionalAttributes Maven / Gradle / Ivy
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