public class Shortcode
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> |
attributes
The attributes.
|
java.lang.String |
content
The content.
|
java.lang.String |
name
The name.
|
| Constructor and Description |
|---|
Shortcode(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> attributes)
Creates a shortcode without content.
|
Shortcode(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> attributes,
java.lang.String content)
Creates a shortcode with content.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
escapeAttribute(java.lang.String val)
Escapes an attribute value.
|
static Shortcode |
parse(java.lang.String shortcode)
Parses a shortcode
|
java.lang.String |
positionalValue(int pos)
Gets a positional attribute value.
|
java.util.List<java.lang.String> |
positionalValues()
Gets a list of any positional values.
|
java.lang.String |
toString() |
Shortcode |
withContent(java.lang.String content)
Adds content to a shortcode.
|
public final java.lang.String name
public final com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> attributes
public final java.lang.String content
public Shortcode(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> attributes)
name - The name.attributes - The attributes.public Shortcode(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> attributes,
java.lang.String content)
name - The name.attributes - The attributes.content - The content.public Shortcode withContent(java.lang.String content)
content - The content.public final java.lang.String positionalValue(int pos)
pos - The position.null if no value at the position.public final java.util.List<java.lang.String> positionalValues()
public final java.lang.String toString()
toString in class java.lang.Objectpublic static Shortcode parse(java.lang.String shortcode) throws java.text.ParseException
shortcode - The shortcode string.java.text.ParseException - on invalid code.public static java.lang.String escapeAttribute(java.lang.String val)
val - The value.