eu.scape_project.xa.tw.util
Class StringConverterUtil

java.lang.Object
  extended by eu.scape_project.xa.tw.util.StringConverterUtil

public class StringConverterUtil
extends Object

StringConverterUtil

Version:
0.3
Author:
shsdev https://github.com/shsdev

Constructor Summary
StringConverterUtil()
           
 
Method Summary
static String packageNameToNamespace(String pn)
          Package name to namespace
static String packageNameToPackagePath(String pn)
          Creates a file path from a package name
static String propToVar(String var)
          Converts property names to variable names, in an arbitrary fashion (replaces all occurrences of "." in the var name with "_".
static String typeToFilename(String var)
          Converts type names to file names, substitutes ":" for "_"
static String varToProp(String var)
          Converts variable names to property names, in an arbitrary fashion (replaces all occurrences of "_" in the var name with ".".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringConverterUtil

public StringConverterUtil()
Method Detail

packageNameToNamespace

public static String packageNameToNamespace(String pn)
Package name to namespace

Parameters:
pn - e.g. eu.scape_project.pc.services
Returns:
e.g. http://scape-project.eu/pc/services

packageNameToPackagePath

public static String packageNameToPackagePath(String pn)
Creates a file path from a package name

Parameters:
pn - the Java package name
Returns:
the file path

varToProp

public static String varToProp(String var)
Converts variable names to property names, in an arbitrary fashion (replaces all occurrences of "_" in the var name with ".".

Parameters:
var - the variable name;
Returns:
property name

propToVar

public static String propToVar(String var)
Converts property names to variable names, in an arbitrary fashion (replaces all occurrences of "." in the var name with "_".

Parameters:
var - the property name
Returns:
the variable name

typeToFilename

public static String typeToFilename(String var)
Converts type names to file names, substitutes ":" for "_"

Parameters:
var - the type name
Returns:
the file name


Copyright © 2013. All Rights Reserved.