org.opends.server.tools.makeldif
Class Tag

java.lang.Object
  extended by org.opends.server.tools.makeldif.Tag
Direct Known Subclasses:
AttributeValueTag, DNTag, FileTag, FirstNameTag, GUIDTag, IfAbsentTag, IfPresentTag, LastNameTag, ListTag, ParentDNTag, PresenceTag, RandomTag, RDNTag, SequentialTag, StaticTextTag, UnderscoreDNTag, UnderscoreParentDNTag

public abstract class Tag
extends java.lang.Object

This class defines a tag that may be used in a template line. It can be used to generate content in the resulting LDIF.


Constructor Summary
Tag()
           
 
Method Summary
abstract  boolean allowedInBranch()
          Indicates whether this tag is allowed for use in the extra lines for branches.
abstract  TagResult generateValue(TemplateEntry templateEntry, TemplateValue templateValue)
          Generates the content for this tag by appending it to the provided tag.
abstract  java.lang.String getName()
          Retrieves the name for this tag.
 void initializeForBranch(TemplateFile templateFile, Branch branch, java.lang.String[] arguments, int lineNumber, java.util.List<Message> warnings)
          Performs any initialization for this tag that may be needed while parsing a branch definition.
 void initializeForParent(TemplateEntry parentEntry)
          Performs any initialization for this tag that may be needed when starting to generate entries below a new parent.
abstract  void initializeForTemplate(TemplateFile templateFile, Template template, java.lang.String[] arguments, int lineNumber, java.util.List<Message> warnings)
          Performs any initialization for this tag that may be needed while parsing a template definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tag

public Tag()
Method Detail

getName

public abstract java.lang.String getName()
Retrieves the name for this tag.

Returns:
The name for this tag.

allowedInBranch

public abstract boolean allowedInBranch()
Indicates whether this tag is allowed for use in the extra lines for branches.

Returns:
true if this tag may be used in branch definitions, or false if not.

initializeForBranch

public void initializeForBranch(TemplateFile templateFile,
                                Branch branch,
                                java.lang.String[] arguments,
                                int lineNumber,
                                java.util.List<Message> warnings)
                         throws InitializationException
Performs any initialization for this tag that may be needed while parsing a branch definition.

Parameters:
templateFile - The template file in which this tag is used.
branch - The branch in which this tag is used.
arguments - The set of arguments provided for this tag.
lineNumber - The line number on which this tag appears in the template file.
warnings - A list into which any appropriate warning messages may be placed.
Throws:
InitializationException - If a problem occurs while initializing this tag.

initializeForTemplate

public abstract void initializeForTemplate(TemplateFile templateFile,
                                           Template template,
                                           java.lang.String[] arguments,
                                           int lineNumber,
                                           java.util.List<Message> warnings)
                                    throws InitializationException
Performs any initialization for this tag that may be needed while parsing a template definition.

Parameters:
templateFile - The template file in which this tag is used.
template - The template in which this tag is used.
arguments - The set of arguments provided for this tag.
lineNumber - The line number on which this tag appears in the template file.
warnings - A list into which any appropriate warning messages may be placed.
Throws:
InitializationException - If a problem occurs while initializing this tag.

initializeForParent

public void initializeForParent(TemplateEntry parentEntry)
Performs any initialization for this tag that may be needed when starting to generate entries below a new parent.

Parameters:
parentEntry - The entry below which the new entries will be generated.

generateValue

public abstract TagResult generateValue(TemplateEntry templateEntry,
                                        TemplateValue templateValue)
Generates the content for this tag by appending it to the provided tag.

Parameters:
templateEntry - The entry for which this tag is being generated.
templateValue - The template value to which the generated content should be appended.
Returns:
The result of generating content for this tag.