Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.modama.common.version
Class ModamaVersionBuilder  view ModamaVersionBuilder download ModamaVersionBuilder.java

java.lang.Object
  extended byorg.modama.common.version.ModamaVersionBuilder

public class ModamaVersionBuilder
extends java.lang.Object

This class loads version.xml file with information about the latest deployed files. One can now increment the version number (head.main.sub) and set the type of the new release (release/beta). After that, the version.xml is saved and various files, that depends on current version information are created, by calling DVSL.


Field Summary
(package private)  org.dom4j.Document document
           
(package private) static java.lang.String[] DVSLFiles
          The files to create.
(package private)  java.net.URL fileURL
           
protected static org.apache.log4j.Logger logger
           
(package private) static java.lang.String X_FULLNAME
           
(package private) static java.lang.String X_NAME
           
(package private) static java.lang.String X_VERSION_HEAD
           
(package private) static java.lang.String X_VERSION_MAIN
           
(package private) static java.lang.String X_VERSION_RELEASE
           
(package private) static java.lang.String X_VERSION_SUB
           
 
Constructor Summary
ModamaVersionBuilder(java.net.URL fileURL)
          create a builder instance with url of version.xml
 
Method Summary
private  java.lang.String getAttributeValue(java.lang.String xpath)
          returns the value of an given attribute
private  void incAttribute(java.lang.String xpath)
          increment an attribute value.
 void incVersionHead()
          increment the head version
 void incVersionMain()
          increment the main version
 void incVersionSub()
          increment the sub version
static void main(java.lang.String[] args)
           
 void printHelpText()
           
private  void readIn()
          load the xml
 void setRelease(java.lang.String rel)
          set the release value to any given string (useful: release or beta)
 java.lang.String toString()
          compose the xml file to something readable
 void writeOut()
          write back xml changes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DVSLFiles

static final java.lang.String[] DVSLFiles
The files to create. for each file, there must be an additional file, with the "dvsl" extension.


X_NAME

static final java.lang.String X_NAME
See Also:
Constant Field Values

X_FULLNAME

static final java.lang.String X_FULLNAME
See Also:
Constant Field Values

X_VERSION_HEAD

static final java.lang.String X_VERSION_HEAD
See Also:
Constant Field Values

X_VERSION_MAIN

static final java.lang.String X_VERSION_MAIN
See Also:
Constant Field Values

X_VERSION_SUB

static final java.lang.String X_VERSION_SUB
See Also:
Constant Field Values

X_VERSION_RELEASE

static final java.lang.String X_VERSION_RELEASE
See Also:
Constant Field Values

logger

protected static org.apache.log4j.Logger logger

document

org.dom4j.Document document

fileURL

java.net.URL fileURL
Constructor Detail

ModamaVersionBuilder

public ModamaVersionBuilder(java.net.URL fileURL)
create a builder instance with url of version.xml

Method Detail

readIn

private void readIn()
load the xml


writeOut

public void writeOut()
write back xml changes


getAttributeValue

private java.lang.String getAttributeValue(java.lang.String xpath)
returns the value of an given attribute


toString

public java.lang.String toString()
compose the xml file to something readable


incAttribute

private void incAttribute(java.lang.String xpath)
increment an attribute value. notice, the value of the attribute MUST be an integer value


incVersionHead

public void incVersionHead()
increment the head version


incVersionMain

public void incVersionMain()
increment the main version


incVersionSub

public void incVersionSub()
increment the sub version


setRelease

public void setRelease(java.lang.String rel)
set the release value to any given string (useful: release or beta)


printHelpText

public void printHelpText()

main

public static void main(java.lang.String[] args)