de.viaboxx.nlstools.tasks
Class Property2XMLConverterTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by de.viaboxx.nlstools.tasks.Property2XMLConverterTask
All Implemented Interfaces:
Cloneable

public class Property2XMLConverterTask
extends org.apache.tools.ant.Task

Description: Create a bundles-xml (or excel) file fromProperty some plain property (or xml) files


example: convert grails-app/i18n/messages_en.properties, messages_de.properties and messages_zh.properties to i18n/messages.xml, where the properties files are stored in UTF-8 encoding:
  <prop2xml locales="en;de;zh" fromProperty="grails-app/i18n/messages"
                  to="i18n/messages.xml" fromCharset="UTF-8"
                  interfaceName="MyMessages"/>
 

Author:
Roman Stumm

Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
Property2XMLConverterTask()
           
 
Method Summary
 void execute()
           
 String getFromCharset()
           
 String getFromProperty()
          path/filename without _de_DE.properties / each locale + .properties will be added to this string to find the properties source file to convert
 String getInterfaceName()
          name of the interface for writing into the xml error-sections file
protected  String getInterfacePackage()
           
 String getLocales()
          all locales for which a resource bundle exists, separated by ;
protected  String getPropertyBaseName()
           
 String getTo()
          path/filename of the xml error-section file to be created
 boolean isXml()
           
 void setFromCharset(String fromCharset)
           
 void setFromProperty(String aFromProperty)
           
 void setInterfaceName(String aInterfaceName)
           
 void setLocales(String aLocales)
           
 void setTo(String aToXML)
           
 void setXml(boolean xml)
           
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Property2XMLConverterTask

public Property2XMLConverterTask()
Method Detail

getFromCharset

public String getFromCharset()

setFromCharset

public void setFromCharset(String fromCharset)

isXml

public boolean isXml()

setXml

public void setXml(boolean xml)

getInterfaceName

public String getInterfaceName()
name of the interface for writing into the xml error-sections file


setInterfaceName

public void setInterfaceName(String aInterfaceName)

getFromProperty

public String getFromProperty()
path/filename without _de_DE.properties / each locale + .properties will be added to this string to find the properties source file to convert

Returns:

setFromProperty

public void setFromProperty(String aFromProperty)

getTo

public String getTo()
path/filename of the xml error-section file to be created

Returns:

setTo

public void setTo(String aToXML)

getLocales

public String getLocales()
all locales for which a resource bundle exists, separated by ;

Returns:

setLocales

public void setLocales(String aLocales)

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException

getPropertyBaseName

protected String getPropertyBaseName()

getInterfacePackage

protected String getInterfacePackage()


Copyright © 2012. All Rights Reserved.