[Snmap-developer] SNMAP/src/net/sf/snmap/mapping Property.java,1.3,1.4 SimpleValue.java,1.1,1.2 Pers
Status: Planning
Brought to you by:
arden
|
From: arden l. <ar...@us...> - 2006-01-19 04:31:45
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7648/src/net/sf/snmap/mapping Modified Files: Property.java SimpleValue.java PersistentClass.java Log Message: Index: Property.java =================================================================== RCS file: /cvsroot/snmap/SNMAP/src/net/sf/snmap/mapping/Property.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Property.java 13 Jan 2006 03:22:46 -0000 1.3 --- Property.java 19 Jan 2006 04:31:35 -0000 1.4 *************** *** 5,56 **** import org.snmp4j.smi.OID; ! public class Property implements Serializable ! { ! private static final long serialVersionUID = -3473315581151895162L; ! private String name; ! private PersistentClass persistentClass; ! private Value value; ! ! // TODO : I have not used oid. ! private OID oid; ! public String getName() ! { ! return name; ! } ! public void setName( String name ) ! { ! this.name = name; ! } ! public PersistentClass getPersistentClass() { ! return persistentClass; ! } ! public void setPersistentClass(PersistentClass persistentClass) { ! this.persistentClass = persistentClass; ! } ! public Value getValue() ! { ! return value; ! } ! public void setValue( Value value ) ! { ! this.value = value; ! } ! ! ! public OID getOid() ! { ! return oid; ! } ! public void setOid( OID oid ) ! { ! this.oid = oid; ! } } --- 5,60 ---- import org.snmp4j.smi.OID; ! public class Property implements Serializable { ! private static final long serialVersionUID = -3473315581151895162L; ! private String name = null; ! private PersistentClass persistentClass = null; ! private Value value = null; ! private Table table = null; ! // TODO : I have not used oid. ! private OID oid; ! public String getName() { ! return name; ! } ! public void setName(String name) { ! this.name = name; ! } ! public PersistentClass getPersistentClass() { ! return persistentClass; ! } ! ! public void setPersistentClass(PersistentClass persistentClass) { ! this.persistentClass = persistentClass; ! } ! ! public Value getValue() { ! return value; ! } ! ! public void setValue(Value value) { ! this.value = value; ! } ! ! public OID getOid() { ! return oid; ! } ! ! public void setOid(OID oid) { ! this.oid = oid; ! } ! ! public Table getTable() { ! return table; ! } ! ! public void setTable(Table table) { ! this.table = table; ! } } Index: SimpleValue.java =================================================================== RCS file: /cvsroot/snmap/SNMAP/src/net/sf/snmap/mapping/SimpleValue.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SimpleValue.java 13 Jan 2006 03:22:28 -0000 1.1 --- SimpleValue.java 19 Jan 2006 04:31:35 -0000 1.2 *************** *** 1,6 **** package net.sf.snmap.mapping; - import org.snmp4j.smi.OID; - import net.sf.snmap.MappingException; import net.sf.snmap.util.ReflectHelper; --- 1,4 ---- *************** *** 8,50 **** /** * Any value that maps to columns. * @author Gavin King */ public class SimpleValue implements KeyValue { ! private static final long serialVersionUID = 8311998547913915506L; private String typeName = null; - - // TODO : I have not used ObjectType. - private ObjectType objectType; public String getTypeName() { return typeName; } public void setTypeName(String type) { this.typeName = type; } - - public boolean isSimpleValue() { - return true; - } - - public void setTypeUsingReflection(String className, String propertyName) throws MappingException { - if (typeName==null) { - if (className==null) { - throw new MappingException("you must specify types for a dynamic entity: " + propertyName); - } - typeName = ReflectHelper.reflectedPropertyClass(className, propertyName).getName(); - } - } ! public ObjectType getObjectType() ! { ! return objectType; ! } ! public void setObjectType( ObjectType objectType ) ! { ! this.objectType = objectType; ! } ! } --- 6,73 ---- /** * Any value that maps to columns. + * * @author Gavin King */ public class SimpleValue implements KeyValue { ! private static final long serialVersionUID = 8311998547913915506L; + /** + * Keep data type. (For instance, Long/Integer/...) + */ private String typeName = null; + // TODO : I have not used ObjectType. + private ObjectType objectType; + + /** + * Implement isSimpleValue(). + * + * @see net.sf.snmap.mapping.Value#isSimpleValue() + */ + public boolean isSimpleValue() { + return true; + } + + /** + * Implement setTypeUsingReflection(). + * + * @see net.sf.snmap.mapping.Value#setTypeUsingReflection(java.lang.String, java.lang.String) + */ + public void setTypeUsingReflection(String className, String propertyName) + throws MappingException { + if (typeName == null) { + if (className == null) { + throw new MappingException( + "you must specify types for a dynamic entity: " + + propertyName); + } + typeName = ReflectHelper.reflectedPropertyClass(className, + propertyName).getName(); + } + } + + /** + * Get typeName. + * @return -- The typeName. + */ public String getTypeName() { return typeName; } + + /** + * Set typeName. + * @param type -- The typeName. + */ public void setTypeName(String type) { this.typeName = type; } ! public ObjectType getObjectType() { ! return objectType; ! } ! ! public void setObjectType(ObjectType objectType) { ! this.objectType = objectType; ! } } Index: PersistentClass.java =================================================================== RCS file: /cvsroot/snmap/SNMAP/src/net/sf/snmap/mapping/PersistentClass.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PersistentClass.java 5 Jan 2006 04:03:22 -0000 1.1 --- PersistentClass.java 19 Jan 2006 04:31:35 -0000 1.2 *************** *** 8,29 **** */ public abstract class PersistentClass implements Serializable { ! /** ! * Class Name. ! */ ! private String className; ! ! private ArrayList<Property> properties = new ArrayList<Property>(); ! ! public String getClassName() { ! return className; ! } ! public void setClassName(String className) { ! this.className = className==null ? null : className.intern(); ! } ! ! public void addProperty(Property p) { ! properties.add(p); ! p.setPersistentClass(this); ! } } \ No newline at end of file --- 8,39 ---- */ public abstract class PersistentClass implements Serializable { ! /** ! * Class Name. ! */ ! private String className; ! private ArrayList<Property> properties = new ArrayList<Property>(); ! ! private Table table = null; ! ! public String getClassName() { ! return className; ! } ! ! public void setClassName(String className) { ! this.className = className == null ? null : className.intern(); ! } ! ! public void addProperty(Property p) { ! properties.add(p); ! p.setPersistentClass(this); ! } ! ! public Table getTable() { ! return table; ! } ! ! public void setTable(Table table) { ! this.table = table; ! } } \ No newline at end of file |