Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.google.sitebricks.compiler;
 
Based on jsoup.nodes.TextNode by Jonathan Hedley, jonathan@hedley.net AnnotationNode is for Sitebricks text annotations such as

Repeat:
...) or @ShowIf(true)
public class AnnotationNode extends TextNode {
    static final String ANNOTATION_KEY = "_annokey";
    static final String ANNOTATION_CONTENT = "_annocontent";
    static final String ANNOTATION = "_annotation";

    
Create a new AnnotationNode representing the supplied (unencoded) text).

Parameters:
annotation raw text
baseUri base uri
See also:
org.jsoup.nodes.TextNode.createFromEncoded(java.lang.String,java.lang.String)
    public AnnotationNode(String annotationString baseUri) {
        super(annotationbaseUri);
        this.annotation(annotation);
    }
    public AnnotationNode(String annotation) {
        super(annotation"");
        this.annotation(annotation);
    }
  
    public String nodeName() {
        return "#annotation";
    }

    
Set the annotation of this node.

Parameters:
annotation raw annotation
Returns:
this, for chaining
    public AnnotationNode annotation(String annotation) {
        this.attr(annotation);
        String[] kc = AnnotationParser.extractKeyAndContent(annotation);
        this.attr(kc[0]);
        this.attr(kc[1]);
        return this;
    }
    public Node apply (Node annotate) {
        annotate.attr(this.attr());
        annotate.attr(this.attr());
        annotate.attr(this.attr());
        return annotate;
    }
New to GrepCode? Check out our FAQ X