org.pojava.persistence.serial
Class RenamedFields

java.lang.Object
  extended by org.pojava.persistence.serial.RenamedFields

public class RenamedFields
extends Object

A simple bean for storing two-way renames.

Author:
John Pile

Constructor Summary
RenamedFields()
           
 
Method Summary
 boolean hasJavaName(String javaName)
          Return true if a map entry exists for the given java name.
 boolean hasXmlName(String xmlName)
          Return true if a map entry exists for the given xml name.
 String javaNameFor(String xmlName)
          Return the java name mapped to the given xml name
 void rename(String javaName, String xmlName)
          Double-map the java-to-xml and xml-to-java entries.
 String xmlNameFor(String javaName)
          Return the xml name mapped to the given java name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenamedFields

public RenamedFields()
Method Detail

rename

public void rename(String javaName,
                   String xmlName)
Double-map the java-to-xml and xml-to-java entries.

Parameters:
javaName -
xmlName -

hasJavaName

public boolean hasJavaName(String javaName)
Return true if a map entry exists for the given java name.

Parameters:
javaName - reference
Returns:
true if a map entry exists for the given java name.

hasXmlName

public boolean hasXmlName(String xmlName)
Return true if a map entry exists for the given xml name.

Parameters:
xmlName -
Returns:
true if a map entry exists for the given xml name.

xmlNameFor

public String xmlNameFor(String javaName)
Return the xml name mapped to the given java name

Parameters:
javaName -
Returns:
the tag used to represent the mapped property

javaNameFor

public String javaNameFor(String xmlName)
Return the java name mapped to the given xml name

Parameters:
xmlName -
Returns:
the property name mapped from the given tag


Copyright © 2011. All Rights Reserved.