1 22 23 package org.xquark.mapper.mapping; 24 25 import org.xquark.mapping.Generator; 26 import org.xquark.mapping.StorageContext; 27 import org.xquark.mapper.storage._StorageContext; 28 29 public class ValueGenerator implements Generator, Cloneable 30 { 31 private static final String RCSRevision = "$Revision: 1.1 $"; 32 private static final String RCSName = "$Name: $"; 33 34 private MappingTypeInfo typeInfo = null; 35 36 public Object getValue(StorageContext context) 37 { 38 Object o = null; 39 if (typeInfo.storeCanonicalString()) 40 o = ((_StorageContext)context).getCanonicalString(); 41 else 42 o = context.getActualNodeData(); 43 44 return o; 45 } 46 47 public void setTypeInfo(MappingTypeInfo typeInfo) 48 { 49 this.typeInfo = typeInfo; 50 } 51 52 public Object clone() 53 { 54 try { 55 return super.clone(); 56 } 57 catch (CloneNotSupportedException e) { 58 return null; 59 } 60 } 61 } 62 | Popular Tags |