net.sf.jpkgmk.prototype
Class Prototype

java.lang.Object
  extended by net.sf.jpkgmk.AbstractFileCreatorAdapter
      extended by net.sf.jpkgmk.prototype.Prototype
All Implemented Interfaces:
FileHandler.ContentWriter

public class Prototype
extends AbstractFileCreatorAdapter

Pure java impl for the creation of a prototype which is normally done with "pkgproto" on unix. Used for "pkgmk" on unix

Since:
1.0
Version:
$Revision: 2 $ $Date: 2008-08-20 21:14:19 +0200 (Mi, 20 Aug 2008) $
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author: gommma $

Nested Class Summary
protected static class Prototype.PrototypeEntryFileSorter
          Sorts the PrototypeEntryFile objects so that the directories are before all other entries
 
Field Summary
static java.lang.String PROTOTYPE
           
 
Constructor Summary
Prototype()
          Default constructor
 
Method Summary
 void add(int insertIndex, PrototypeEntry entry)
          Adds a prototype entry.
 void add(PrototypeEntry entry)
          Adds a prototype entry.
 boolean contains(PrototypeEntry entry)
           
 void createFiles(java.io.File targetDir)
           
 PkgMap createPackage(java.io.File targetDir)
          Creates the package which includes the creation of all files that contain to the package as well as the java object PkgMap.
 PkgMap createPkgMap(java.io.File targetDir)
           
 FileHandler getFileHandler(java.io.File targetDir)
           
 java.util.List<PrototypeEntry> getPrototypeEntryList()
           
 VariableMap getVariableMap()
           
 boolean remove(PrototypeEntry entry)
           
 void setVariableMap(VariableMap variableMap)
           
 java.lang.String toPrettyString()
           
 java.lang.String toString()
           
 void writeContent(java.io.Writer writer)
           
 
Methods inherited from class net.sf.jpkgmk.AbstractFileCreatorAdapter
clean, create
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOTYPE

public static final java.lang.String PROTOTYPE
See Also:
Constant Field Values
Constructor Detail

Prototype

public Prototype()
Default constructor

Method Detail

getVariableMap

public VariableMap getVariableMap()

setVariableMap

public void setVariableMap(VariableMap variableMap)

writeContent

public void writeContent(java.io.Writer writer)
                  throws java.io.IOException
Throws:
java.io.IOException

getFileHandler

public FileHandler getFileHandler(java.io.File targetDir)
Specified by:
getFileHandler in class AbstractFileCreatorAdapter

add

public void add(PrototypeEntry entry)
Adds a prototype entry. Does not create the physical file yet

Parameters:
entry - New entry to add

add

public void add(int insertIndex,
                PrototypeEntry entry)
Adds a prototype entry. Does not create the physical file yet

Parameters:
insertIndex - The index where to insert the given entry
entry - New entry to add

remove

public boolean remove(PrototypeEntry entry)

contains

public boolean contains(PrototypeEntry entry)

getPrototypeEntryList

public java.util.List<PrototypeEntry> getPrototypeEntryList()
Returns:
Returs the list of prototype entries in the order they were added before

createPackage

public PkgMap createPackage(java.io.File targetDir)
                     throws java.io.IOException
Creates the package which includes the creation of all files that contain to the package as well as the java object PkgMap. Note that the physical pkgmap file is not created.

Parameters:
targetDir - The directory where all target files are copied to/created in.
Returns:
The object representation PkgMap of the pkgmap file.
Throws:
java.io.IOException

createPkgMap

public PkgMap createPkgMap(java.io.File targetDir)
Parameters:
targetDir - The directory in which the physical files for the pkgMapEntries are located
Returns:
The result pkgmap object

createFiles

public void createFiles(java.io.File targetDir)
                 throws java.io.IOException
Throws:
java.io.IOException

toPrettyString

public java.lang.String toPrettyString()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2007-2008. All Rights Reserved.