terp - the Codemesh Modular
Template Interpreter v1.3.337

com.codemesh.terp.data
Class Path.Impl

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector<java.lang.Object>
              extended by com.codemesh.terp.data.Path.Impl
All Implemented Interfaces:
Path, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.lang.Object>, java.util.Collection<java.lang.Object>, java.util.List<java.lang.Object>, java.util.RandomAccess
Enclosing interface:
Path

public static class Path.Impl
extends java.util.Vector<java.lang.Object>
implements Path

A grouping interface for file paths, including patterns. Paths require relatively little explanation in general, they are simply ordered collections of pathroots. As such, a path can be constructed from a single file or string representing a file, from a collection or array of legal pathroots, and from a map containing a base directory and inclusion/ exclusion patterns.

This latter construction mode deserves a more detailed explanation. Let's say that you want to create a path containing all jar files in the current directory. You would simply use a map as input:

 { dir:'.', include:'*.jar', exclude:'test.jar'}
 
The exclusion is simply there to demonstrate that you don't have to accept all files of a certain pattern on the path.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.codemesh.terp.data.Path
Path.Impl
 
Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Fields inherited from interface com.codemesh.terp.data.Path
DIR, EXCLUDE, FILE, INCLUDE, PATH
 
Constructor Summary
Path.Impl()
          Creates an empty path.
Path.Impl(java.util.Collection coll)
          Creates a path that is the concatenation of all collection elements.
Path.Impl(java.io.File dir, java.lang.String include)
          Convenience constructor to create a path from a base directory and an inclusion pattern.
 
Method Summary
static Path fromArray(java.lang.Object[] arr)
           
static Path fromCollection(java.util.Collection coll)
           
static Path fromFile(java.io.File location)
           
static Path fromMap(java.util.Map<java.lang.String,java.lang.Object> map)
           
static Path fromMap(Path result, java.util.Map<java.lang.String,java.lang.Object> map)
           
static Path fromString(java.lang.String path)
          Create a path from a simple path string without performing validation.
static Path fromString(java.lang.String path, boolean bValidate)
          Create a path from a simple path string.
 java.lang.String toString()
          Returns the fully expanded path in string form, using the current platform's path separator.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Constructor Detail

Path.Impl

public Path.Impl()
Creates an empty path.


Path.Impl

public Path.Impl(java.util.Collection coll)
Creates a path that is the concatenation of all collection elements. The path conversion function is called individually on all collection elements before they are added to the path.

Parameters:
coll - the collection of path members.

Path.Impl

public Path.Impl(java.io.File dir,
                 java.lang.String include)
Convenience constructor to create a path from a base directory and an inclusion pattern.

Parameters:
dir - the base directory.
include - the inclusion pattern.
Method Detail

fromString

public static Path fromString(java.lang.String path)
Create a path from a simple path string without performing validation. A path string may contain wildcard characters (asterisks).

Parameters:
path - the path string.
Returns:
the created path.

fromString

public static Path fromString(java.lang.String path,
                              boolean bValidate)
Create a path from a simple path string. A path string may contain wildcard characters (asterisks).

Parameters:
path - the path string.
bValidate - true to perform validation.
Returns:
the created path.

fromFile

public static Path fromFile(java.io.File location)

fromArray

public static Path fromArray(java.lang.Object[] arr)

fromCollection

public static Path fromCollection(java.util.Collection coll)

fromMap

public static Path fromMap(java.util.Map<java.lang.String,java.lang.Object> map)

fromMap

public static Path fromMap(Path result,
                           java.util.Map<java.lang.String,java.lang.Object> map)

toString

public java.lang.String toString()
Returns the fully expanded path in string form, using the current platform's path separator.

Overrides:
toString in class java.util.Vector<java.lang.Object>
Returns:
an expanded path string.

terp - the Codemesh Modular
Template Interpreter v1.3.337

Copyright © 2008-2016 by Codemesh, Inc. All Rights Reserved.