Docmosis API 4.5.0

com.docmosis.template.store
Class TemplateIdentifier

java.lang.Object
  extended bycom.docmosis.template.store.TemplateIdentifier
Direct Known Subclasses:
TemplateDetails

public class TemplateIdentifier
extends Object

A Template can be uniquely identified by a name and a context. It is dependent on the type of TemplateStore used as to what might constitute a context. Typically the context is simply a path-like string such as "project1/templates/"


Constructor Summary
TemplateIdentifier(String name)
          Construct a new template identifier with the given name and a template context matching the root (or top-level) of the store.
TemplateIdentifier(String name, String context)
          Construct a new template identifier with the given name and context.
TemplateIdentifier(String name, TemplateContext context)
          Construct a new identifier with the given name and context.
 
Method Summary
static TemplateIdentifier createUniqueTempTemplateIdentifier()
          Create a unique template identifier, typically useful only for templates that are temporary in nature.
 boolean equals(Object other)
           
static TemplateIdentifier fromPath(String fullPath)
          Construct a TemplateIdentifier from a full path to a template (template an context combined).
 TemplateContext getContext()
          Get the context of this template.
 String getFullPath()
          Return the context plus name as a path (/)
 String getName()
          Get the name for this template id.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TemplateIdentifier

public TemplateIdentifier(String name)
Construct a new template identifier with the given name and a template context matching the root (or top-level) of the store.

Parameters:
name - the template name.

TemplateIdentifier

public TemplateIdentifier(String name,
                          String context)
Construct a new template identifier with the given name and context.

Parameters:
name - the template name
context - the context name

TemplateIdentifier

public TemplateIdentifier(String name,
                          TemplateContext context)
Construct a new identifier with the given name and context.

Parameters:
name - the name for the template
context - the context (path) for the template. A null context means the root (or top-level) of the store.
Method Detail

getName

public String getName()
Get the name for this template id.


fromPath

public static TemplateIdentifier fromPath(String fullPath)
Construct a TemplateIdentifier from a full path to a template (template an context combined). The path can be delimited by '/' or '\' characters and the path is optional.

Parameters:
fullPath - the context and path combined.
Returns:
a corresponding TemplateIdentifier

getContext

public TemplateContext getContext()
Get the context of this template. The context equates to a location in a path or hierarchy, allowing multiple templates of the same name to exist in different locations (contexts). A null context indicates that the template exists at the root of the TemplateStore.

Returns:
the template context or null if there isn't one.
See Also:
TemplateStore

getFullPath

public String getFullPath()
Return the context plus name as a path (/)

Returns:
just the name if the context is null.

equals

public boolean equals(Object other)

hashCode

public int hashCode()

toString

public String toString()

createUniqueTempTemplateIdentifier

public static TemplateIdentifier createUniqueTempTemplateIdentifier()
Create a unique template identifier, typically useful only for templates that are temporary in nature.

Returns:
a unique TemplateIdentifier

Docmosis API 4.5.0

Copyright © 2014 Docmosis Pty Ltd. All Rights Reserved.