All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nuggets.delegate.DTimeZone Maven / Gradle / Ivy

The newest version!
/*
 * DString.java
 * Copyright (c) 2005 by University of Hamburg. All Rights Reserved.
 * Departament of Informatics. 
 * Distributed Systems and Information Systems.
 *
 * Created by walczak on Jan 17, 2006.  
 * Last revision $Revision: 4687 $ by:
 * $Author: walczak $ on $Date: 2006-12-21 11:38:59 +0100 (Do, 21 Dez 2006) $.
 */
package nuggets.delegate;

import java.util.TimeZone;

import nuggets.IAssembler;
import nuggets.ICruncher;


/** DString 
 * @author walczak
 * @since  Jan 17, 2006
 */
public class DTimeZone extends ADelegate
{

	/** 
	 * @param clazz
	 * @param asm
	 * @return a new instance of this array
	 * @throws Exception
	 */
	public Object getInstance(Class clazz,IAssembler asm) throws Exception
   {
      return TimeZone.getTimeZone((String)asm.getAttributeValue("id"));
   }

   /** 
    * @param o
    * @param mill
    * @see nuggets.delegate.ASimpleDelegate#persist(java.lang.Object, nuggets.ICruncher)
    */
   public void persist(Object o, ICruncher mill, ClassLoader classloader)
   {
		  mill.startConcept(o);
      mill.put("id", ((TimeZone)o).getID());
   }

//   /** 
//    * @param exp
// * @return exp+".getID()";
//    * @see nuggets.delegate.ASimpleDelegate#getMarshallString(java.lang.String)
//    */
//   public String getMarshallString(String exp)
//   {
//      return exp+".getID()";
//   }

	/** 
	 * @param clazz
	 * @param o
	 * @return the name of the class
	 * @see nuggets.delegate.ADelegate#marshall(java.lang.Class, java.lang.Object)
	 */
	public String marshall(Class clazz, Object o)
	{
		return ((TimeZone)o).getID();
	}
   
//   /** 
//    * @param exp
// * @return "java.util.TimeZone.getTimeZone((String)"+exp+"))";
//    * @see nuggets.delegate.ASimpleDelegate#getUnmarshallString(String, java.lang.String)
//    */
//   public String getUnmarshallString(String className, String exp)
//   {
//      return "java.util.TimeZone.getTimeZone((String)"+exp+")";
//   }
//   
//	/** 
//	 * @param clazz
//	 * @param value
//	 * @return the boolean expression
//	 * @see nuggets.delegate.ASimpleDelegate#unmarshall(java.lang.Class, java.lang.Object)
//	 */
//	public Object unmarshall(Class clazz, Object value)
//	{
//		return TimeZone.getTimeZone((String)value);
//	}  
//  

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy