public final class ConstantTagFactory extends Object implements TagFactory
Constructor and Description |
---|
ConstantTagFactory(String key,
String value)
Construct a new instance that will always return a Tag with the specified value.
|
ConstantTagFactory(Tag tag)
Construct a new instance that will always return the specified tag.
|
Modifier and Type | Method and Description |
---|---|
Tag |
createTag()
Produces a tag based on the runtime context available to the factory.
|
String |
name()
Returns the name of the factory, which is used as the key for any Tag
produced by the createTag method.
|
public ConstantTagFactory(String key, String value)
key
- the non-null key for the tagvalue
- the non-null value for the tagpublic ConstantTagFactory(Tag tag)
tag
- the non-null Tag instance to return from createTagpublic String name()
TagFactory
name
in interface TagFactory
public Tag createTag()
TagFactory
createTag
in interface TagFactory