snmap-developer Mailing List for snmap (Page 3)
Status: Planning
Brought to you by:
arden
You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(23) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
(2) |
| 2007 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
(3) |
May
(2) |
Jun
(1) |
Jul
(5) |
Aug
(3) |
Sep
(11) |
Oct
(10) |
Nov
(23) |
Dec
(36) |
| 2009 |
Jan
(9) |
Feb
(13) |
Mar
(11) |
Apr
(21) |
May
(37) |
Jun
(21) |
Jul
(22) |
Aug
(7) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(15) |
| 2010 |
Jan
(8) |
Feb
(6) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(4) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(3) |
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
|
From: <an...@to...> - 2007-02-28 18:56:16
|
贵公司负责人(经理/财务)您好:
我是深圳市振达实业有限公司的。我司实力雄厚,有着良
好的社会关系。因进项较多现完成不了每月销售额度, 每月有
一部分增值税电脑发票、(6%左右)海关代征(3%左右)和普通商
品销售广告、服务费、劳务费、咨询费、交通运输、建筑安装、
餐饮,租赁等国税、地税发票( 0.8%至1%左右)。优惠代开
或合作,点数较低,还可以根据所做数量额度的大小来商讨优
惠的点数。公司成立多年一直坚持以“诚信”为中心立足于商
场中,本公司郑重承诺所用绝对是真票!更希望能够有机会与
贵司合作!
如贵司在发票的真伪方面有任疑虑或担心,可上网查证或
我司直接与贵司去税务局抵扣核对。
彼此合作一次,必成永久朋友!
此信息长期有效,如须进一步洽商:
详情请电:013928413118
联 系 人: 刘金胜
顺祝商祺!
深圳市振达实业有限公司
|
|
From: <sz...@26...> - 2007-01-24 20:39:35
|
贵公司负责人(经理/财务)您好:
我是深圳益宝实业有限公司 的。有着良好的社会关系。因进项较多现完成不了每月销售额度, 每
月有一部分增值税电脑发票、海关代征(6%左右)和普通商品销售、广告、服务费、劳务费、咨询费、
交通运输、建筑安装、餐饮等国税、地税发票( 1.5%至1%左右)。优惠代开或合作,点数较低,还可
以根据所做数量额度的大小来商讨优惠的点数。公司成立多年一直坚持以"诚信"为中心立足于商场中,
本公司郑重承诺所用绝对是真票!更希望能够有机会与贵司合作!
如贵司在发票的真伪方面有任疑虑或担心,可上网查证或我司直接与贵司去税务局抵扣核对。
彼此合作一次,必成永久朋友!
此信息长期有效,如须进一步洽商:
详情请电:13590129826
联 系 人: 张纪中
顺祝商祺!
深圳益宝实业有限公司
|
|
From: <an...@to...> - 2007-01-21 04:49:31
|
贵公司负责人(经理/财务)您好:
本公司为税务机关代开发票授权公司.本公司现有全国各
地各种行业固定纳税公司的余额发票.可以优惠对外开具.每月
有一部分增值税电脑发票(7%左右)海关代征(3%)和普通发票收
取税率为0.8-1%,详细税率可根据地区.行业.票额大小商谈!
普通国税发票为商品销售(包含所有行业的商品)。普
通地税发票为建筑、安装、广告、设计、运输、租赁、咨询、
培训、旅游、住宿等其它服务行业 。
本公司与全国各地区各行业的公司有发票业务来往。本
公司只需收到贵公司的开票内容后,便会通过税务机关筛选
出相匹配的行业及适合的公司开具发票。
由于本公司规模宏大、实力雄厚。完全可以依照贵公司的
需求来进行合作!公司本着顾客至上的宗旨,可先开具发票给
贵公司,待上网验证或到税务验证后再付款!
本公司确保所开具之发票为税务机关领取的真票,对于双
方的合作关系绝对保密。公司真诚寻找合作伙伴,若贵公司有
什么需要或有其它疑虑问题。欢迎来电咨询!
此信息长期有效,如须进一步洽商:
代理人:李少明
手 机: 013798523038
邮 箱: szx...@16...
顺祝商祺!
深圳市金丰实业有限公司
|
|
From: <lz...@16...> - 2007-01-19 00:39:41
|
深圳市财横通贸易有限公司(报关行) 公司地址: 深圳市福田区八卦邻二路六栋一楼D9号东 电 话: 86 -0755 -25410329 联 系 人: 胡先生 (业务部 经理) 移动电话: 13632973336 传 真: 86 -0755- 25408625 邮 编: 518000 邮 箱: szc...@si... 公司网站: http://szcht.cn.35so.cn 深圳港口盐田/蛇口最新买单报关价 序号 品名 报关费,单证,商检 序号 品名 报关费,单证,商检 (港建另算) (港建另算) 1 木家私 RMB:500/柜 23 袋、包、旅行箱、 拉竿箱、帽子 RMB:600/柜 2 木制品 RMB:550/柜 24 PU鞋、拖鞋、 塑料鞋等 RMB:700/柜 3 服装 RMB:600/柜 25 皮鞋、布鞋 RMB:750/柜 4 纸制品 RMB:550/柜 26 灯饰类 RMB:700/柜 5 塑料制品类 RMB:500/柜 27 电子表、石英表 RMB:1200/柜 6 塑料工艺品类 RMB:550/柜 28 电子钟、石英钟 RMB:800/柜 7 铁制工艺品类 RMB:600/柜 29 VCD、MP3 RMB:1600/柜 8 圣诞工艺品类 RMB:600/柜 30 DVD无牌 RMB:1800/柜 9 日用陶瓷类 RMB:750/柜 31 录音机 RMB:950/柜 10 工艺陶瓷类 RMB:800/柜 32 音箱 RMB:900/柜 11 瓷砖 RMB:650/柜 33 电脑、打印机配件 RMB:800/柜 12 电动玩具 RMB:700/柜 34 变压器 RMB:850/柜 13 塑料玩具类 RMB:600/柜 35 桑拿房 RMB:1000/柜 14 填充玩具 RMB:650/柜 36 杂货柜 RMB:1500-2000/柜 15 按摩器 RMB:850/柜 37 食品柜 RMB:2500-3500/柜 16 按摩坐垫 RMB:850/柜 38 化妆品柜 RMB:2500-3800/柜 17 电话机 RMB:700/柜 39 防牌货 RMB:4000/柜 18 电视机无牌 RMB:1600/柜 40 冻柜 RMB:4300/柜 19 电风扇无牌 RMB:1500/柜 41 茶叶 RMB:4300/柜 20 电冰箱无牌 RMB:1800/柜 42 矿产柜 RMB:6500/柜 21 洗衣机无牌 RMB:1800/柜 43 敏感产品 RMB:5800 22 摩托车无牌 RMB:1800/柜 详情欢迎到我公司洽谈,或来电来函垂询。祝商祺! 深圳市财横通贸易有限公司 胡厚程 (业务部 经理) 移动电话: 13632973336 公司地址: 深圳市福田区八卦邻二路六栋一楼D9号东 电 话: 86 -0755 -25410329 传 真: 86 -0755- 25408625 邮 编: 518000 邮 箱: szc...@si... 公司网站: http://szcht.cn.35so.cn |
|
From: <ng...@12...> - 2007-01-18 09:54:01
|
深圳市财横通贸易有限公司(报关行) 公司地址: 深圳市福田区八卦邻二路六栋一楼D9号东 电 话: 86 -0755 -25410329 联 系 人: 胡先生 (业务部 经理) 移动电话: 13632973336 传 真: 86 -0755- 25408625 邮 编: 518000 邮 箱: szc...@si... 公司网站: http://szcht.cn.35so.cn 深圳港口盐田/蛇口最新买单报关价 序号 品名 报关费,单证,商检 序号 品名 报关费,单证,商检 (港建另算) (港建另算) 1 木家私 RMB:500/柜 23 袋、包、旅行箱、 拉竿箱、帽子 RMB:600/柜 2 木制品 RMB:550/柜 24 PU鞋、拖鞋、 塑料鞋等 RMB:700/柜 3 服装 RMB:600/柜 25 皮鞋、布鞋 RMB:750/柜 4 纸制品 RMB:550/柜 26 灯饰类 RMB:700/柜 5 塑料制品类 RMB:500/柜 27 电子表、石英表 RMB:1200/柜 6 塑料工艺品类 RMB:550/柜 28 电子钟、石英钟 RMB:800/柜 7 铁制工艺品类 RMB:600/柜 29 VCD、MP3 RMB:1600/柜 8 圣诞工艺品类 RMB:600/柜 30 DVD无牌 RMB:1800/柜 9 日用陶瓷类 RMB:750/柜 31 录音机 RMB:950/柜 10 工艺陶瓷类 RMB:800/柜 32 音箱 RMB:900/柜 11 瓷砖 RMB:650/柜 33 电脑、打印机配件 RMB:800/柜 12 电动玩具 RMB:700/柜 34 变压器 RMB:850/柜 13 塑料玩具类 RMB:600/柜 35 桑拿房 RMB:1000/柜 14 填充玩具 RMB:650/柜 36 杂货柜 RMB:1500-2000/柜 15 按摩器 RMB:850/柜 37 食品柜 RMB:2500-3500/柜 16 按摩坐垫 RMB:850/柜 38 化妆品柜 RMB:2500-3800/柜 17 电话机 RMB:700/柜 39 防牌货 RMB:4000/柜 18 电视机无牌 RMB:1600/柜 40 冻柜 RMB:4300/柜 19 电风扇无牌 RMB:1500/柜 41 茶叶 RMB:4300/柜 20 电冰箱无牌 RMB:1800/柜 42 矿产柜 RMB:6500/柜 21 洗衣机无牌 RMB:1800/柜 43 敏感产品 RMB:5800 22 摩托车无牌 RMB:1800/柜 详情欢迎到我公司洽谈,或来电来函垂询。祝商祺! 深圳市财横通贸易有限公司 胡厚程 (业务部 经理) 移动电话: 13632973336 公司地址: 深圳市福田区八卦邻二路六栋一楼D9号东 电 话: 86 -0755 -25410329 传 真: 86 -0755- 25408625 邮 编: 518000 邮 箱: szc...@si... 公司网站: http://szcht.cn.35so.cn |
|
From: <an...@to...> - 2006-12-21 20:30:14
|
贵公司负责人(经理/财务)您好:
本公司为税务机关代开发票授权公司.本公司现有全国各
地各种行业固定纳税公司的余额发票.可以优惠对外开具.每月
有一部分增值税电脑发票(7%左右)海关代征(3%)和普通发票收
取税率为0.8-1%,详细税率可根据地区.行业.票额大小商谈!
普通国税发票为商品销售(包含所有行业的商品)。普
通地税发票为建筑、安装、广告、设计、运输、租赁、咨询、
培训、旅游、住宿等其它服务行业 。
本公司与全国各地区各行业的公司有发票业务来往。本
公司只需收到贵公司的开票内容后,便会通过税务机关筛选
出相匹配的行业及适合的公司开具发票。
由于本公司规模宏大、实力雄厚。完全可以依照贵公司的
需求来进行合作!公司本着顾客至上的宗旨,可先开具发票给
贵公司,待上网验证或到税务验证后再付款!
本公司确保所开具之发票为税务机关领取的真票,对于双
方的合作关系绝对保密。公司真诚寻找合作伙伴,若贵公司有
什么需要或有其它疑虑问题。欢迎来电咨询!
此信息长期有效,如须进一步洽商:
代理人:张俊辉
手 机: 013798527268
邮 箱: szx...@16...
顺祝商祺!
上海市宏发实业有限公司
|
|
From: LIU <GH...@16...> - 2006-12-16 14:05:12
|
你好:我公司长期优惠提供出口核销单,商检,买单,另外有国税和地税发票可以代开
有需要请来电联系。
联系电话:020-35828661 83627316 13660699218 13723497393
联 系 人:刘 伟 刘 国 强
顺祝:生意兴隆
|
|
From: <sz...@26...> - 2006-11-29 07:31:25
|
致一(厂.公司)财务.经理:你好!
深圳市诚希实业发展有限公司是2002年5月经深圳市财政局批准(许可证为深财字1108号).
工商注册登记号(深司字N00831)成立的税务代理公司,(全国各大.中城市均有分公司)本公
司本着互惠互利的原则合理对外优惠代开发票,代开范围有:(普通商品销售发票.广告发票.
运输发票.其他服务行业发票.建筑安装发票.增值税发票.海关代征<<增值税>>专要缴款书.)
如贵公司在做帐或销项方面需要用的话,我公司可提供全方位的服务.欢迎广大客户来电洽谈!
本公司郑重承诺!所有票据均可网上查询或税局验证!详情请联系!
联系电话:13510563889
联 系 人;刘志强
|
|
From: ad_pic_078 <ad_...@12...> - 2006-08-13 09:31:54
|
http://d.haotu123.cn/ |
|
From: arden l. <ar...@us...> - 2006-01-19 04:32:01
|
Update of /cvsroot/snmap/SNMAP/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7712/doc Modified Files: ProjectInformation.cn.odt Log Message: Index: ProjectInformation.cn.odt =================================================================== RCS file: /cvsroot/snmap/SNMAP/doc/ProjectInformation.cn.odt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsyeGSYy and /tmp/cvsGQQrgS differ |
|
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 |
|
From: arden l. <ar...@us...> - 2006-01-19 04:31:31
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7595/src/net/sf/snmap/cfg Modified Files: SnmapBinder.java Environment.java Log Message: Index: SnmapBinder.java =================================================================== RCS file: /cvsroot/snmap/SNMAP/src/net/sf/snmap/cfg/SnmapBinder.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SnmapBinder.java 13 Jan 2006 03:23:44 -0000 1.2 --- SnmapBinder.java 19 Jan 2006 04:31:20 -0000 1.3 *************** *** 1,8 **** package net.sf.snmap.cfg; - import java.util.ArrayList; - import java.util.HashSet; import java.util.Iterator; ! import java.util.Properties; import net.sf.snmap.MappingException; --- 1,6 ---- package net.sf.snmap.cfg; import java.util.Iterator; ! import java.util.Map; import net.sf.snmap.MappingException; *************** *** 11,14 **** --- 9,13 ---- import net.sf.snmap.mapping.RootClass; import net.sf.snmap.mapping.Property; + import net.sf.snmap.mapping.Table; import net.sf.snmap.mapping.Value; import net.sf.snmap.mapping.SimpleValue; *************** *** 25,238 **** * metamodel (the classes in the <tt>mapping</tt> package) */ ! public final class SnmapBinder ! { ! private static final Log log = LogFactory.getLog( SnmapBinder.class ); ! /** ! * Private constructor to disallow instantiation. ! */ ! private SnmapBinder() ! {} ! /** ! * The main contract into the hbm.xml-based binder. Performs necessary ! * binding operations represented by the given DOM. ! * ! * @param doc ! * The DOM to be parsed and bound. ! * @param mappings ! * Current bind state. ! * @param inheritedMetas ! * Any inherited meta-tag information. ! * @throws MappingException ! */ ! public static void bindRoot( Document doc, Mappings mappings, java.util.Map inheritedMetas ) ! throws MappingException ! { ! // Get extend information (package) ! SnmapBinder.getExtendsNeeded( doc, mappings ); ! Element hmNode = doc.getRootElement(); ! Iterator nodes = hmNode.elementIterator( "class" ); ! while( nodes.hasNext() ) ! { ! Element n = (Element) nodes.next(); ! RootClass rootclass = new RootClass(); ! bindRootClass( n, rootclass, mappings, inheritedMetas ); ! mappings.addClass( rootclass ); ! } ! } ! /** ! * Responsible for perfoming the bind operation related to an <class/> ! * mapping element. ! * ! * @param node ! * The DOM Element for the <class/> element. ! * @param rootClass ! * The mapping instance to which to bind the information. ! * @param mappings ! * The current bind state. ! * @param inheritedMetas ! * Any inherited meta-tag information. ! * @throws MappingException ! */ ! public static void bindRootClass( Element node, RootClass rootClass, Mappings mappings, ! java.util.Map inheritedMetas ) throws MappingException ! { ! bindClass( node, rootClass, mappings, inheritedMetas ); ! bindRootPersistentClassCommonValues( node, inheritedMetas, mappings, rootClass ); ! } ! private static void bindRootPersistentClassCommonValues( Element node, ! java.util.Map inheritedMetas, Mappings mappings, RootClass entity ) throws MappingException ! { ! Iterator subnodes = node.elementIterator(); ! while( subnodes.hasNext() ) ! { ! Element subnode = (Element) subnodes.next(); ! String name = subnode.getName(); ! // TODO : check Table? ! if ("table".equals(name)) { ! } ! } ! createClassProperties( node, entity, mappings, inheritedMetas ); ! } ! public static void getExtendsNeeded( Document doc, Mappings mappings ) ! { ! final Element hmNode = doc.getRootElement(); ! Attribute packNode = hmNode.attribute( "package" ); ! if( packNode != null ) ! mappings.setDefaultPackage( packNode.getValue() ); ! } ! public static void bindClass( Element node, PersistentClass persistentClass, Mappings mappings, ! java.util.Map inheritedMetas ) throws MappingException ! { ! bindPojoRepresentation( node, persistentClass, mappings, inheritedMetas ); ! } ! protected static void createClassProperties( Element node, PersistentClass persistentClass, ! Mappings mappings, java.util.Map inheritedMetas ) throws MappingException ! { ! createClassProperties( node, persistentClass, mappings, inheritedMetas, true, true ); ! } ! protected static void createClassProperties( Element node, PersistentClass persistentClass, ! Mappings mappings, java.util.Map inheritedMetas, boolean mutable, boolean nullable ) ! throws MappingException ! { ! Iterator iter = node.elementIterator(); ! while( iter.hasNext() ) ! { ! Element subnode = (Element) iter.next(); ! String name = subnode.getName(); ! String propertyName = subnode.attributeValue( "name" ); ! ! Value value = null; ! ! if( "property".equals( name ) ) ! { ! value = new SimpleValue(); ! bindSimpleValue( subnode, (SimpleValue) value, nullable, propertyName, mappings ); ! } ! if( value != null ) ! { ! Property property = createProperty( value, propertyName, persistentClass ! .getClassName(), subnode, mappings, inheritedMetas ); ! persistentClass.addProperty( property ); ! } ! } ! } ! private static void bindPojoRepresentation( Element node, PersistentClass entity, ! Mappings mappings, java.util.Map metaTags ) ! { ! String className = getClassName( node.attribute( "name" ), mappings ); ! entity.setClassName( className ); ! } ! private static String getClassName( Attribute att, Mappings model ) ! { ! if( att == null ) ! return null; ! return getClassName( att.getValue(), model ); ! } ! private static String getClassName( String unqualifiedName, Mappings model ) ! { ! if( unqualifiedName == null ) ! return null; ! if( unqualifiedName.indexOf( '.' ) < 0 && model.getDefaultPackage() != null ) ! { ! return model.getDefaultPackage() + '.' + unqualifiedName; ! } ! return unqualifiedName; ! } ! private static Property createProperty( final Value value, final String propertyName, ! final String className, final Element subnode, final Mappings mappings, ! java.util.Map inheritedMetas ) throws MappingException ! { ! value.setTypeUsingReflection( className, propertyName ); ! Property prop = new Property(); ! prop.setValue( value ); ! bindProperty( subnode, prop, mappings, inheritedMetas ); ! return prop; ! } ! ! // automatically makes a ?? with OID ! public static void bindSimpleValue(Element node, SimpleValue simpleValue, boolean isNullable, ! String path, Mappings mappings) throws MappingException { ! bindOid( node, simpleValue, isNullable, path, mappings ); ! } ! ! public static void bindProperty( Element node, Property property, Mappings mappings, ! java.util.Map inheritedMetas ) throws MappingException ! { ! String propName = node.attributeValue( "name" ); ! property.setName( propName ); ! } ! ! public static void bindOid(final Element node, final SimpleValue simpleValue, ! final boolean isNullable, final String propertyPath, ! final Mappings mappings) throws MappingException { ! // OID ! Attribute oidAttribute = node.attribute( "oid" ); ! if ( oidAttribute == null ) { ! throw new MappingException( ! "oid attribute should not be null." ); ! } ! else { ! ObjectType objectType = new ObjectType(); ! objectType.setValue( simpleValue ); ! bindObjectType( node, objectType, isNullable ); ! ! simpleValue.setObjectType(objectType); ! ! } ! ! } ! public static void bindObjectType(Element node, ObjectType objectType, boolean isNullable) { ! Attribute oidNode = node.attribute( "oid" ); ! if ( oidNode != null ) ! { ! OID oid = new OID(oidNode.getValue()); ! objectType.setOid(oid); ! } ! } } --- 24,297 ---- * metamodel (the classes in the <tt>mapping</tt> package) */ ! public final class SnmapBinder { ! private static final Log log = LogFactory.getLog(SnmapBinder.class); ! /** ! * Private constructor to disallow instantiation. ! */ ! private SnmapBinder() { ! } ! /** ! * The main contract into the hbm.xml-based binder. Performs necessary ! * binding operations represented by the given DOM. ! * ! * @param doc ! * The DOM to be parsed and bound. ! * @param mappings ! * Current bind state. ! * @param inheritedMetas ! * Any inherited meta-tag information. ! * @throws MappingException ! */ ! public static void bindRoot(Document doc, Mappings mappings, ! java.util.Map inheritedMetas) throws MappingException { ! // Get extend information (package) ! SnmapBinder.getExtendsNeeded(doc, mappings); ! Element hmNode = doc.getRootElement(); ! Iterator nodes = hmNode.elementIterator("class"); ! while (nodes.hasNext()) { ! Element n = (Element) nodes.next(); ! RootClass rootclass = new RootClass(); ! bindRootClass(n, rootclass, mappings, inheritedMetas); ! mappings.addClass(rootclass); ! } ! } ! /** ! * Responsible for perfoming the bind operation related to an <class/> ! * mapping element. ! * ! * @param node ! * The DOM Element for the <class/> element. ! * @param rootClass ! * The mapping instance to which to bind the information. ! * @param mappings ! * The current bind state. ! * @param inheritedMetas ! * Any inherited meta-tag information. ! * @throws MappingException ! */ ! public static void bindRootClass(Element node, RootClass rootClass, ! Mappings mappings, java.util.Map inheritedMetas) ! throws MappingException { ! bindClass(node, rootClass, mappings, inheritedMetas); ! bindRootPersistentClassCommonValues(node, inheritedMetas, mappings, ! rootClass); ! } ! private static void bindRootPersistentClassCommonValues(Element node, ! java.util.Map inheritedMetas, Mappings mappings, RootClass entity) ! throws MappingException { ! Iterator subnodes = node.elementIterator(); ! while (subnodes.hasNext()) { ! Element subnode = (Element) subnodes.next(); ! String name = subnode.getName(); ! // Check "table". ! if ("table".equals(name)) { ! // bind table information. ! bindTable(subnode, entity, mappings, inheritedMetas); ! } ! } ! createClassProperties(node, entity, mappings, inheritedMetas); ! } ! private static void bindTable(Element node, RootClass entity, ! Mappings mappings, Map inheritedMetas) { ! Iterator subnodes = node.elementIterator(); ! while (subnodes.hasNext()) { ! Element subnode = (Element) subnodes.next(); ! String name = subnode.getName(); ! if ("id".equals(name)) { ! // ID ! bindSimpleId(subnode, entity, mappings, inheritedMetas); ! } ! // TODO : I will support composite-id later. ! //else if ( "composite-id".equals( name ) ) { ! // // COMPOSITE-ID ! // bindCompositeId( subnode, entity, mappings, inheritedMetas ); ! //} ! ! // Table property. ! createTableProperties(node, entity, mappings, inheritedMetas); ! } ! } ! private static void createTableProperties(Element node, RootClass entity, ! net.sf.snmap.cfg.Mappings mappings, Map inheritedMetas) { ! Iterator iter = node.elementIterator(); ! while (iter.hasNext()) { ! Element subnode = (Element) iter.next(); ! String name = subnode.getName(); ! String propertyName = subnode.attributeValue("name"); ! Value value = null; ! if ("property".equals(name)) { ! value = new SimpleValue(); ! bindSimpleValue(subnode, (SimpleValue) value, false, ! propertyName, mappings); ! } ! if (value != null) { ! // TODO : ??? ! /* ! * Property property = createProperty( value, propertyName, ! * persistentClass .getClassName(), subnode, mappings, ! * inheritedMetas ); ! * ! * table.addProperty( property ); ! */ ! Property property = new Property(); ! entity.getTable().addProperty( property ); ! } ! } ! } ! private static void bindSimpleId(Element idNode, RootClass entity, ! Mappings mappings, Map inheritedMetas) { ! String propertyName = idNode.attributeValue("name"); ! SimpleValue id = new SimpleValue(); ! entity.getTable().setIdentifier(id); ! bindSimpleValue(idNode, id, false, propertyName, mappings); ! id.setTypeUsingReflection(entity.getClassName(), propertyName); ! } ! public static void getExtendsNeeded(Document doc, Mappings mappings) { ! final Element hmNode = doc.getRootElement(); ! Attribute packNode = hmNode.attribute("package"); ! if (packNode != null) ! mappings.setDefaultPackage(packNode.getValue()); ! } ! public static void bindClass(Element node, PersistentClass persistentClass, ! Mappings mappings, java.util.Map inheritedMetas) ! throws MappingException { ! bindPojoRepresentation(node, persistentClass, mappings, inheritedMetas); ! } ! protected static void createClassProperties(Element node, ! PersistentClass persistentClass, Mappings mappings, ! java.util.Map inheritedMetas) throws MappingException { ! createClassProperties(node, persistentClass, mappings, inheritedMetas, ! true, true); ! } ! ! protected static void createClassProperties(Element node, ! PersistentClass persistentClass, Mappings mappings, ! java.util.Map inheritedMetas, boolean mutable, boolean nullable) ! throws MappingException { ! ! Iterator iter = node.elementIterator(); ! while (iter.hasNext()) { ! Element subnode = (Element) iter.next(); ! String name = subnode.getName(); ! String propertyName = subnode.attributeValue("name"); ! ! Value value = null; ! ! if ("property".equals(name)) { ! value = new SimpleValue(); ! bindSimpleValue(subnode, (SimpleValue) value, nullable, ! propertyName, mappings); ! } ! ! if (value != null) { ! Property property = createProperty(value, propertyName, ! persistentClass.getClassName(), subnode, mappings, ! inheritedMetas); ! ! persistentClass.addProperty(property); ! } ! ! } ! } ! ! private static void bindPojoRepresentation(Element node, ! PersistentClass entity, Mappings mappings, java.util.Map metaTags) { ! ! String className = getClassName(node.attribute("name"), mappings); ! entity.setClassName(className); ! } ! ! private static String getClassName(Attribute att, Mappings model) { ! if (att == null) ! return null; ! return getClassName(att.getValue(), model); ! } ! ! private static String getClassName(String unqualifiedName, Mappings model) { ! if (unqualifiedName == null) ! return null; ! if (unqualifiedName.indexOf('.') < 0 ! && model.getDefaultPackage() != null) { ! return model.getDefaultPackage() + '.' + unqualifiedName; ! } ! return unqualifiedName; ! } ! ! private static Property createProperty(final Value value, ! final String propertyName, final String className, ! final Element subnode, final Mappings mappings, ! java.util.Map inheritedMetas) throws MappingException { ! value.setTypeUsingReflection(className, propertyName); ! ! Property prop = new Property(); ! prop.setValue(value); ! bindProperty(subnode, prop, mappings, inheritedMetas); ! return prop; ! } ! ! // automatically makes a ?? with OID ! public static void bindSimpleValue(Element node, SimpleValue simpleValue, ! boolean isNullable, String path, Mappings mappings) ! throws MappingException { ! bindOid(node, simpleValue, isNullable, path, mappings); ! } ! ! public static void bindProperty(Element node, Property property, ! Mappings mappings, java.util.Map inheritedMetas) ! throws MappingException { ! String propName = node.attributeValue("name"); ! property.setName(propName); ! } ! ! public static void bindOid(final Element node, ! final SimpleValue simpleValue, final boolean isNullable, ! final String propertyPath, final Mappings mappings) ! throws MappingException { ! // OID ! Attribute oidAttribute = node.attribute("oid"); ! if (oidAttribute == null) { ! throw new MappingException("oid attribute should not be null."); ! } else { ! ObjectType objectType = new ObjectType(); ! objectType.setValue(simpleValue); ! bindObjectType(node, objectType, isNullable); ! ! simpleValue.setObjectType(objectType); ! } ! } ! ! public static void bindObjectType(Element node, ObjectType objectType, ! boolean isNullable) { ! Attribute oidNode = node.attribute("oid"); ! if (oidNode != null) { ! OID oid = new OID(oidNode.getValue()); ! objectType.setOid(oid); ! } ! } } Index: Environment.java =================================================================== RCS file: /cvsroot/snmap/SNMAP/src/net/sf/snmap/cfg/Environment.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Environment.java 10 Dec 2005 23:05:58 -0000 1.2 --- Environment.java 19 Jan 2006 04:31:20 -0000 1.3 *************** *** 1,10 **** package net.sf.snmap.cfg; import java.util.Properties; public final class Environment { public static final String VERSION = "0.0.1"; ! /** * Return <tt>System</tt> properties, extended by any properties specified --- 1,33 ---- package net.sf.snmap.cfg; + import java.util.HashMap; + import java.util.Iterator; + import java.util.Map; import java.util.Properties; + import org.apache.commons.logging.Log; + import org.apache.commons.logging.LogFactory; + public final class Environment { public static final String VERSION = "0.0.1"; ! ! private static final Map OBSOLETE_PROPERTIES = new HashMap(); ! ! private static final Log log = LogFactory.getLog(Environment.class); ! ! /** ! * Issues warnings to the user when any obsolete property names are used. ! * (In current version, there is not any obsolete property.) ! */ ! public static void verifyProperties(Properties props) { ! Iterator iter = props.keySet().iterator(); ! while ( iter.hasNext() ) { ! Object oldProp = iter.next(); ! Object newProp = OBSOLETE_PROPERTIES.get(oldProp); ! if ( newProp!=null ) log.warn("Usage of obsolete property: " + oldProp + " no longer supported, use: " + newProp); ! } ! } ! /** * Return <tt>System</tt> properties, extended by any properties specified *************** *** 15,19 **** public static Properties getProperties() { Properties copy = new Properties(); - // copy.putAll(GLOBAL_PROPERTIES); return copy; } --- 38,41 ---- |
|
From: arden l. <ar...@us...> - 2006-01-19 04:31:17
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7407/src/net/sf/snmap/mapping Added Files: Table.java Log Message: --- NEW FILE: Table.java --- package net.sf.snmap.mapping; import java.io.Serializable; import java.util.ArrayList; import org.snmp4j.smi.OID; public class Table implements Serializable { private static final long serialVersionUID = -2411044919840199371L; private OID oid = null; private KeyValue identifier; private ArrayList<Property> properties = new ArrayList<Property>(); public OID getOid() { return oid; } public void setOid(OID oid) { this.oid = oid; } public KeyValue getIdentifier() { return identifier; } public void setIdentifier(KeyValue identifier) { this.identifier = identifier; } public void addProperty(Property p) { properties.add(p); p.setTable(this); } } |
|
From: arden l. <ar...@us...> - 2006-01-19 04:20:26
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4476/src/net/sf/snmap/util Modified Files: ReflectHelper.java Log Message: Index: ReflectHelper.java =================================================================== RCS file: /cvsroot/snmap/SNMAP/src/net/sf/snmap/util/ReflectHelper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReflectHelper.java 13 Jan 2006 03:26:04 -0000 1.2 --- ReflectHelper.java 19 Jan 2006 04:20:14 -0000 1.3 *************** *** 7,100 **** import net.sf.snmap.MappingException; import net.sf.snmap.PropertyNotFoundException; import net.sf.snmap.property.Getter; public final class ReflectHelper { - private static final Class[] NO_CLASSES = new Class[0]; ! /** ! * Check input class could be instantiable. ! * ! * @param clazz -- ! * The Class for checking. ! * @return -- The result. ! */ ! public static boolean isInstantiable(Class clazz) { ! int modifier = clazz.getModifiers(); ! return !(Modifier.isAbstract(modifier) || Modifier ! .isInterface(modifier)); ! } ! /** ! * Checking input Class and Member is public. ! * ! * @param clazz -- ! * The Class for checking. ! * @param member -- ! * The Member for checking. ! * @return -- The result. ! */ ! public static boolean isPublic(Class clazz, Member member) { ! return Modifier.isPublic(member.getModifiers()) ! && Modifier.isPublic(clazz.getModifiers()); ! } ! /** ! * Get Default Constructor. ! * ! * @param clazz -- ! * The input Class. ! * @return -- The Constructor. ! * @throws PropertyNotFoundException ! */ ! public static Constructor getDefaultConstructor(Class clazz) ! throws PropertyNotFoundException { ! if (!isInstantiable(clazz)) ! return null; ! try { ! Constructor constructor = clazz.getDeclaredConstructor(NO_CLASSES); ! if (!isPublic(clazz, constructor)) { ! constructor.setAccessible(true); ! } ! return constructor; ! } catch (NoSuchMethodException nme) { ! throw new PropertyNotFoundException("Object class " ! + clazz.getName() ! + " must declare a default (no-argument) constructor"); ! } ! } ! ! public static Class classForName(String name) throws ClassNotFoundException { ! try { ! ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); ! if(contextClassLoader!=null) { ! return contextClassLoader.loadClass(name); ! } else { ! return Class.forName(name); ! } ! } ! catch (Exception e) { ! return Class.forName(name); ! } ! } ! ! public static Class reflectedPropertyClass(String className, String name) throws MappingException { ! try { ! Class clazz = ReflectHelper.classForName(className); ! return getter(clazz, name).getReturnType(); ! } ! catch (ClassNotFoundException cnfe) { ! throw new MappingException("class " + className + " not found while looking for property: " + name, cnfe); ! } ! } ! ! private static Getter getter(Class clazz, String name) throws MappingException { ! try { ! return BASIC_PROPERTY_ACCESSOR.getGetter(clazz, name); ! } ! catch (PropertyNotFoundException pnfe) { ! return DIRECT_PROPERTY_ACCESSOR.getGetter(clazz, name); ! } ! } } --- 7,109 ---- import net.sf.snmap.MappingException; import net.sf.snmap.PropertyNotFoundException; + import net.sf.snmap.property.BasicPropertyAccessor; + import net.sf.snmap.property.DirectPropertyAccessor; import net.sf.snmap.property.Getter; + import net.sf.snmap.property.PropertyAccessor; public final class ReflectHelper { ! private static final PropertyAccessor BASIC_PROPERTY_ACCESSOR = new BasicPropertyAccessor(); ! private static final PropertyAccessor DIRECT_PROPERTY_ACCESSOR = new DirectPropertyAccessor(); ! private static final Class[] NO_CLASSES = new Class[0]; ! /** ! * Check input class could be instantiable. ! * ! * @param clazz -- ! * The Class for checking. ! * @return -- The result. ! */ ! public static boolean isInstantiable(Class clazz) { ! int modifier = clazz.getModifiers(); ! return !(Modifier.isAbstract(modifier) || Modifier ! .isInterface(modifier)); ! } ! /** ! * Checking input Class and Member is public. ! * ! * @param clazz -- ! * The Class for checking. ! * @param member -- ! * The Member for checking. ! * @return -- The result. ! */ ! public static boolean isPublic(Class clazz, Member member) { ! return Modifier.isPublic(member.getModifiers()) ! && Modifier.isPublic(clazz.getModifiers()); ! } ! ! /** ! * Get Default Constructor. ! * ! * @param clazz -- ! * The input Class. ! * @return -- The Constructor. ! * @throws PropertyNotFoundException ! */ ! public static Constructor getDefaultConstructor(Class clazz) ! throws PropertyNotFoundException { ! ! if (!isInstantiable(clazz)) ! return null; ! ! try { ! Constructor constructor = clazz.getDeclaredConstructor(NO_CLASSES); ! if (!isPublic(clazz, constructor)) { ! constructor.setAccessible(true); ! } ! return constructor; ! } catch (NoSuchMethodException nme) { ! throw new PropertyNotFoundException("Object class " ! + clazz.getName() ! + " must declare a default (no-argument) constructor"); ! } ! } ! ! public static Class classForName(String name) throws ClassNotFoundException { ! try { ! ClassLoader contextClassLoader = Thread.currentThread() ! .getContextClassLoader(); ! if (contextClassLoader != null) { ! return contextClassLoader.loadClass(name); ! } else { ! return Class.forName(name); ! } ! } catch (Exception e) { ! return Class.forName(name); ! } ! } ! ! public static Class reflectedPropertyClass(String className, String name) ! throws MappingException { ! try { ! Class clazz = ReflectHelper.classForName(className); ! return getter(clazz, name).getReturnType(); ! } catch (ClassNotFoundException cnfe) { ! throw new MappingException("class " + className ! + " not found while looking for property: " + name, cnfe); ! } ! } ! ! private static Getter getter(Class clazz, String name) ! throws MappingException { ! try { ! return BASIC_PROPERTY_ACCESSOR.getGetter(clazz, name); ! } catch (PropertyNotFoundException pnfe) { ! return DIRECT_PROPERTY_ACCESSOR.getGetter(clazz, name); ! } ! } } |
|
From: arden l. <ar...@us...> - 2006-01-19 04:19:36
|
Update of /cvsroot/snmap/SNMAP/.settings In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4174/.settings Modified Files: org.eclipse.jdt.core.prefs Log Message: Index: org.eclipse.jdt.core.prefs =================================================================== RCS file: /cvsroot/snmap/SNMAP/.settings/org.eclipse.jdt.core.prefs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** org.eclipse.jdt.core.prefs 10 Dec 2005 05:06:39 -0000 1.1 --- org.eclipse.jdt.core.prefs 19 Jan 2006 04:19:27 -0000 1.2 *************** *** 1,3 **** ! #Sat Dec 10 00:06:19 EST 2005 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled --- 1,3 ---- ! #Wed Jan 18 23:19:09 EST 2006 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled *************** *** 11,12 **** --- 11,256 ---- org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.5 + org.eclipse.jdt.core.formatter.align_type_members_on_columns=false + org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 + org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 + org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 + org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 + org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 + org.eclipse.jdt.core.formatter.alignment_for_assignment=0 + org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 + org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 + org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 + org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 + org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 + org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 + org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 + org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 + org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 + org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 + org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 + org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 + org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 + org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 + org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 + org.eclipse.jdt.core.formatter.blank_lines_after_package=1 + org.eclipse.jdt.core.formatter.blank_lines_before_field=1 + org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 + org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 + org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 + org.eclipse.jdt.core.formatter.blank_lines_before_method=1 + org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 + org.eclipse.jdt.core.formatter.blank_lines_before_package=0 + org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 + org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line + org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line + org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line + org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line + org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line + org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line + org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line + org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line + org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line + org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line + org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line + org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false + org.eclipse.jdt.core.formatter.comment.format_comments=true + org.eclipse.jdt.core.formatter.comment.format_header=false + org.eclipse.jdt.core.formatter.comment.format_html=true + org.eclipse.jdt.core.formatter.comment.format_source_code=true + org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true + org.eclipse.jdt.core.formatter.comment.indent_root_tags=true + org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert + org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert + org.eclipse.jdt.core.formatter.comment.line_length=80 + org.eclipse.jdt.core.formatter.compact_else_if=true + org.eclipse.jdt.core.formatter.continuation_indentation=2 + org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 + org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false + org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true + org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true + org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true + org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true + org.eclipse.jdt.core.formatter.indent_empty_lines=false + org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true + org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true + org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true + org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false + org.eclipse.jdt.core.formatter.indentation.size=4 + org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert + org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert + org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert + org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert + org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert + org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert + org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert + org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert + org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert + org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert + org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert + org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert + org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert + org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert + org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert + org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert + org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert + org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert + org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert + org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert + org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert + org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert + org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert + org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert + org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert + org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert + org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert + org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert + org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert + org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert + org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert + org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert + org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert + org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert + org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert + org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert + org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert + org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert + org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert + org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert + org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert + org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert + org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert + org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert + org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert + org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert + org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert + org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert + org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert + org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert + org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false + org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false + org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false + org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false + org.eclipse.jdt.core.formatter.lineSplit=80 + org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 + org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 + org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true + org.eclipse.jdt.core.formatter.tabulation.char=tab + org.eclipse.jdt.core.formatter.tabulation.size=4 + org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false |
|
From: arden l. <ar...@us...> - 2006-01-19 04:01:14
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/property In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29714/src/net/sf/snmap/property Added Files: DirectPropertyAccessor.java Log Message: --- NEW FILE: DirectPropertyAccessor.java --- //$Id$ package net.sf.snmap.property; import java.lang.reflect.Field; import java.lang.reflect.Method; import net.sf.snmap.PropertyAccessException; import net.sf.snmap.PropertyNotFoundException; import net.sf.snmap.SnmapException; import net.sf.snmap.util.ReflectHelper; /** * Accesses fields directly. * * @author Gavin King */ public class DirectPropertyAccessor implements PropertyAccessor { public static final class DirectGetter implements Getter { private static final long serialVersionUID = -6883616998837775509L; private final transient Field field; private final Class clazz; private final String name; DirectGetter(Field field, Class clazz, String name) { this.field = field; this.clazz = clazz; this.name = name; } public Object get(Object target) throws SnmapException { try { return field.get(target); } catch (Exception e) { throw new PropertyAccessException(e, "could not get a field value by reflection", false, clazz, name); } } public Object getForInsert(Object target) { return get(target); } public Method getMethod() { return null; } public String getMethodName() { return null; } public Class getReturnType() { return field.getType(); } Object readResolve() { return new DirectGetter(getField(clazz, name), clazz, name); } public String toString() { return "DirectGetter(" + clazz.getName() + '.' + name + ')'; } } public static final class DirectSetter implements Setter { private static final long serialVersionUID = 3629766642024955521L; private final transient Field field; private final Class clazz; private final String name; DirectSetter(Field field, Class clazz, String name) { this.field = field; this.clazz = clazz; this.name = name; } public Method getMethod() { return null; } public String getMethodName() { return null; } public void set(Object target, Object value) throws SnmapException { try { field.set(target, value); } catch (Exception e) { throw new PropertyAccessException(e, "could not set a field value by reflection", true, clazz, name); } } public String toString() { return "DirectSetter(" + clazz.getName() + '.' + name + ')'; } Object readResolve() { return new DirectSetter(getField(clazz, name), clazz, name); } } private static Field getField(Class clazz, String name) throws PropertyNotFoundException { if (clazz == null || clazz == Object.class) { // TODO: we should report what class we started searching for the // property - right now it will always end on. Object.class. throw new PropertyNotFoundException("field not found: " + name); } Field field; try { field = clazz.getDeclaredField(name); } catch (NoSuchFieldException nsfe) { field = getField(clazz.getSuperclass(), name); } if (!ReflectHelper.isPublic(clazz, field)) field.setAccessible(true); return field; } public Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException { return new DirectGetter(getField(theClass, propertyName), theClass, propertyName); } public Setter getSetter(Class theClass, String propertyName) throws PropertyNotFoundException { return new DirectSetter(getField(theClass, propertyName), theClass, propertyName); } } |
|
From: arden l. <ar...@us...> - 2006-01-13 03:26:12
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7995/src/net/sf/snmap/util Modified Files: ReflectHelper.java Log Message: Index: ReflectHelper.java =================================================================== RCS file: /cvsroot/snmap/SNMAP/src/net/sf/snmap/util/ReflectHelper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReflectHelper.java 10 Dec 2005 06:12:15 -0000 1.1 --- ReflectHelper.java 13 Jan 2006 03:26:04 -0000 1.2 *************** *** 5,9 **** --- 5,11 ---- import java.lang.reflect.Modifier; + import net.sf.snmap.MappingException; import net.sf.snmap.PropertyNotFoundException; + import net.sf.snmap.property.Getter; public final class ReflectHelper { *************** *** 64,66 **** --- 66,100 ---- } + public static Class classForName(String name) throws ClassNotFoundException { + try { + ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); + if(contextClassLoader!=null) { + return contextClassLoader.loadClass(name); + } else { + return Class.forName(name); + } + } + catch (Exception e) { + return Class.forName(name); + } + } + + public static Class reflectedPropertyClass(String className, String name) throws MappingException { + try { + Class clazz = ReflectHelper.classForName(className); + return getter(clazz, name).getReturnType(); + } + catch (ClassNotFoundException cnfe) { + throw new MappingException("class " + className + " not found while looking for property: " + name, cnfe); + } + } + + private static Getter getter(Class clazz, String name) throws MappingException { + try { + return BASIC_PROPERTY_ACCESSOR.getGetter(clazz, name); + } + catch (PropertyNotFoundException pnfe) { + return DIRECT_PROPERTY_ACCESSOR.getGetter(clazz, name); + } + } } |
|
From: arden l. <ar...@us...> - 2006-01-13 03:25:55
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/property In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7932/src/net/sf/snmap/property Added Files: Setter.java BasicPropertyAccessor.java Getter.java PropertyAccessor.java Log Message: --- NEW FILE: Getter.java --- //$Id$ package net.sf.snmap.property; import java.io.Serializable; import java.lang.reflect.Method; import net.sf.snmap.SnmapException; /** * Gets values of a particular property * * @author Gavin King */ public interface Getter extends Serializable { /** * Get the property value from the given instance . * @param owner The instance containing the value to be retreived. * @return The extracted value. * @throws HibernateException */ public Object get(Object owner) throws SnmapException; /** * Get the declared Java type */ public Class getReturnType(); /** * Optional operation (return null) */ public String getMethodName(); /** * Optional operation (return null) */ public Method getMethod(); } --- NEW FILE: BasicPropertyAccessor.java --- //$Id$ package net.sf.snmap.property; import java.beans.Introspector; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import net.sf.snmap.PropertyAccessException; import net.sf.snmap.PropertyNotFoundException; import net.sf.snmap.SnmapException; import net.sf.snmap.util.ReflectHelper; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * Accesses property values via a get/set pair, which may be nonpublic. * The default (and recommended strategy). * @author Gavin King */ public class BasicPropertyAccessor implements PropertyAccessor { private static final Log log = LogFactory.getLog(BasicPropertyAccessor.class); public static final class BasicSetter implements Setter { private static final long serialVersionUID = 3986040833426548238L; private Class clazz; private final transient Method method; private final String propertyName; private BasicSetter(Class clazz, Method method, String propertyName) { this.clazz=clazz; this.method=method; this.propertyName=propertyName; } public void set(Object target, Object value) throws SnmapException { try { method.invoke( target, new Object[] { value } ); } catch (NullPointerException npe) { if ( value==null && method.getParameterTypes()[0].isPrimitive() ) { throw new PropertyAccessException(npe, "Null value was assigned to a property of primitive type", true, clazz, propertyName); } else { throw new PropertyAccessException(npe, "NullPointerException occurred while calling", true, clazz, propertyName); } } catch (InvocationTargetException ite) { throw new PropertyAccessException(ite, "Exception occurred inside", true, clazz, propertyName); } catch (IllegalAccessException iae) { throw new PropertyAccessException(iae, "IllegalAccessException occurred while calling", true, clazz, propertyName); //cannot occur } catch (IllegalArgumentException iae) { if ( value==null && method.getParameterTypes()[0].isPrimitive() ) { throw new PropertyAccessException(iae, "Null value was assigned to a property of primitive type", true, clazz, propertyName); } else { log.error( "IllegalArgumentException in class: " + clazz.getName() + ", setter method of property: " + propertyName ); log.error( "expected type: " + method.getParameterTypes()[0].getName() + ", actual value: " + ( value==null ? null : value.getClass().getName() ) ); throw new PropertyAccessException(iae, "IllegalArgumentException occurred while calling", true, clazz, propertyName); } } } public Method getMethod() { return method; } public String getMethodName() { return method.getName(); } Object readResolve() { return createSetter(clazz, propertyName); } public String toString() { return "BasicSetter(" + clazz.getName() + '.' + propertyName + ')'; } } public static final class BasicGetter implements Getter { private static final long serialVersionUID = 3952031236835264141L; private Class clazz; private final transient Method method; private final String propertyName; private BasicGetter(Class clazz, Method method, String propertyName) { this.clazz=clazz; this.method=method; this.propertyName=propertyName; } public Object get(Object target) throws SnmapException { try { return method.invoke(target, ((Object[])null)); } catch (InvocationTargetException ite) { throw new PropertyAccessException(ite, "Exception occurred inside", false, clazz, propertyName); } catch (IllegalAccessException iae) { throw new PropertyAccessException(iae, "IllegalAccessException occurred while calling", false, clazz, propertyName); //cannot occur } catch (IllegalArgumentException iae) { log.error( "IllegalArgumentException in class: " + clazz.getName() + ", getter method of property: " + propertyName ); throw new PropertyAccessException(iae, "IllegalArgumentException occurred calling", false, clazz, propertyName); } } public Object getForInsert(Object target) { return get( target ); } public Class getReturnType() { return method.getReturnType(); } public Method getMethod() { return method; } public String getMethodName() { return method.getName(); } public String toString() { return "BasicGetter(" + clazz.getName() + '.' + propertyName + ')'; } Object readResolve() { return createGetter(clazz, propertyName); } } public Setter getSetter(Class theClass, String propertyName) throws PropertyNotFoundException { return createSetter(theClass, propertyName); } private static Setter createSetter(Class theClass, String propertyName) throws PropertyNotFoundException { BasicSetter result = getSetterOrNull(theClass, propertyName); if (result==null) { throw new PropertyNotFoundException( "Could not find a setter for property " + propertyName + " in class " + theClass.getName() ); } return result; } private static BasicSetter getSetterOrNull(Class theClass, String propertyName) { if (theClass==Object.class || theClass==null) return null; Method method = setterMethod(theClass, propertyName); if (method!=null) { if ( !ReflectHelper.isPublic(theClass, method) ) method.setAccessible(true); return new BasicSetter(theClass, method, propertyName); } else { BasicSetter setter = getSetterOrNull( theClass.getSuperclass(), propertyName ); if (setter==null) { Class[] interfaces = theClass.getInterfaces(); for ( int i=0; setter==null && i<interfaces.length; i++ ) { setter=getSetterOrNull( interfaces[i], propertyName ); } } return setter; } } private static Method setterMethod(Class theClass, String propertyName) { BasicGetter getter = getGetterOrNull(theClass, propertyName); Class returnType = (getter==null) ? null : getter.getReturnType(); Method[] methods = theClass.getDeclaredMethods(); Method potentialSetter = null; for (int i=0; i<methods.length; i++) { String methodName = methods[i].getName(); if ( methods[i].getParameterTypes().length==1 && methodName.startsWith("set") ) { String testStdMethod = Introspector.decapitalize( methodName.substring(3) ); String testOldMethod = methodName.substring(3); if ( testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName) ) { potentialSetter = methods[i]; if ( returnType==null || methods[i].getParameterTypes()[0].equals(returnType) ) return potentialSetter; } } } return potentialSetter; } public Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException { return createGetter(theClass, propertyName); } public static Getter createGetter(Class theClass, String propertyName) throws PropertyNotFoundException { BasicGetter result = getGetterOrNull(theClass, propertyName); if (result==null) { throw new PropertyNotFoundException( "Could not find a getter for " + propertyName + " in class " + theClass.getName() ); } return result; } private static BasicGetter getGetterOrNull(Class theClass, String propertyName) { if (theClass==Object.class || theClass==null) return null; Method method = getterMethod(theClass, propertyName); if (method!=null) { if ( !ReflectHelper.isPublic(theClass, method) ) method.setAccessible(true); return new BasicGetter(theClass, method, propertyName); } else { BasicGetter getter = getGetterOrNull( theClass.getSuperclass(), propertyName ); if (getter==null) { Class[] interfaces = theClass.getInterfaces(); for ( int i=0; getter==null && i<interfaces.length; i++ ) { getter=getGetterOrNull( interfaces[i], propertyName ); } } return getter; } } private static Method getterMethod(Class theClass, String propertyName) { Method[] methods = theClass.getDeclaredMethods(); for (int i=0; i<methods.length; i++) { // only carry on if the method has no parameters if ( methods[i].getParameterTypes().length==0 ) { String methodName = methods[i].getName(); // try "get" if( methodName.startsWith("get") ) { String testStdMethod = Introspector.decapitalize( methodName.substring(3) ); String testOldMethod = methodName.substring(3); if( testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName) ) return methods[i]; } // if not "get" then try "is" /*boolean isBoolean = methods[i].getReturnType().equals(Boolean.class) || methods[i].getReturnType().equals(boolean.class);*/ if( methodName.startsWith("is") ) { String testStdMethod = Introspector.decapitalize( methodName.substring(2) ); String testOldMethod = methodName.substring(2); if( testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName) ) return methods[i]; } } } return null; } } --- NEW FILE: PropertyAccessor.java --- package net.sf.snmap.property; import net.sf.snmap.PropertyNotFoundException; /** * Abstracts the notion of a "property". Defines a strategy for accessing the * value of an attribute. * @author Gavin King */ public interface PropertyAccessor { /** * Create a "getter" for the named attribute */ public Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException; /** * Create a "setter" for the named attribute */ public Setter getSetter(Class theClass, String propertyName) throws PropertyNotFoundException; } --- NEW FILE: Setter.java --- package net.sf.snmap.property; import java.io.Serializable; import java.lang.reflect.Method; import net.sf.snmap.SnmapException; /** * Sets values to a particular property. * * @author Gavin King */ public interface Setter extends Serializable { /** * Set the property value from the given instance * * @param target The instance upon which to set the given value. * @param value The value to be set on the target. * @param factory The session factory from which this request originated. * @throws HibernateException */ public void set(Object target, Object value) throws SnmapException; /** * Optional operation (return null) */ public String getMethodName(); /** * Optional operation (return null) */ public Method getMethod(); } |
|
From: arden l. <ar...@us...> - 2006-01-13 03:25:49
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/property In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7907/src/net/sf/snmap/property Log Message: Directory /cvsroot/snmap/SNMAP/src/net/sf/snmap/property added to the repository |
|
From: arden l. <ar...@us...> - 2006-01-13 03:23:53
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7683/src/net/sf/snmap/cfg Modified Files: SnmapBinder.java Log Message: Index: SnmapBinder.java =================================================================== RCS file: /cvsroot/snmap/SNMAP/src/net/sf/snmap/cfg/SnmapBinder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SnmapBinder.java 19 Dec 2005 03:05:58 -0000 1.1 --- SnmapBinder.java 13 Jan 2006 03:23:44 -0000 1.2 *************** *** 1,8 **** --- 1,16 ---- package net.sf.snmap.cfg; + import java.util.ArrayList; + import java.util.HashSet; import java.util.Iterator; import java.util.Properties; import net.sf.snmap.MappingException; + import net.sf.snmap.mapping.ObjectType; + import net.sf.snmap.mapping.PersistentClass; + import net.sf.snmap.mapping.RootClass; + import net.sf.snmap.mapping.Property; + import net.sf.snmap.mapping.Value; + import net.sf.snmap.mapping.SimpleValue; import org.apache.commons.logging.Log; *************** *** 11,14 **** --- 19,23 ---- import org.dom4j.Document; import org.dom4j.Element; + import org.snmp4j.smi.OID; /** *************** *** 16,179 **** * metamodel (the classes in the <tt>mapping</tt> package) */ ! public final class SnmapBinder { ! private static final Log log = LogFactory.getLog(SnmapBinder.class); ! /** ! * Private constructor to disallow instantiation. ! */ ! private SnmapBinder() { ! } ! /** ! * The main contract into the hbm.xml-based binder. Performs necessary ! * binding operations represented by the given DOM. ! * ! * @param doc ! * The DOM to be parsed and bound. ! * @param mappings ! * Current bind state. ! * @param inheritedMetas ! * Any inherited meta-tag information. ! * @throws MappingException ! */ ! public static void bindRoot(Document doc, Mappings mappings, ! java.util.Map inheritedMetas) throws MappingException { ! java.util.List names = HbmBinder.getExtendsNeeded(doc, mappings); ! if (!names.isEmpty()) { ! // classes mentioned in extends not available - so put it in queue ! for (Iterator iter = names.iterator(); iter.hasNext();) { ! String className = (String) iter.next(); ! mappings.addToExtendsQueue(className, doc); ! } ! return; ! } ! Element hmNode = doc.getRootElement(); ! inheritedMetas = getMetas(hmNode, inheritedMetas, true); // get ! // meta's ! // from ! // <hibernate-mapping> ! extractRootAttributes(hmNode, mappings); ! Iterator filterDefs = hmNode.elementIterator("filter-def"); ! while (filterDefs.hasNext()) { ! parseFilterDef((Element) filterDefs.next(), mappings); ! } ! Iterator typeDefs = hmNode.elementIterator("typedef"); ! while (typeDefs.hasNext()) { ! Element typeDef = (Element) typeDefs.next(); ! String typeClass = typeDef.attributeValue("class"); ! String typeName = typeDef.attributeValue("name"); ! Iterator paramIter = typeDef.elementIterator("param"); ! Properties parameters = new Properties(); ! while (paramIter.hasNext()) { ! Element param = (Element) paramIter.next(); ! parameters.setProperty(param.attributeValue("name"), param ! .getTextTrim()); ! } ! mappings.addTypeDef(typeName, typeClass, parameters); ! } ! Iterator nodes = hmNode.elementIterator("class"); ! while (nodes.hasNext()) { ! Element n = (Element) nodes.next(); ! // RootClass rootclass = new RootClass(); ! // bindRootClass( n, rootclass, mappings, inheritedMetas ); ! // mappings.addClass( rootclass ); ! } ! Iterator subclassnodes = hmNode.elementIterator("subclass"); ! while (subclassnodes.hasNext()) { ! Element subnode = (Element) subclassnodes.next(); ! // PersistentClass superModel = getSuperclass( mappings, subnode ); ! // handleSubclass( superModel, mappings, subnode, inheritedMetas ); ! } ! Iterator joinedsubclassnodes = hmNode ! .elementIterator("joined-subclass"); ! while (joinedsubclassnodes.hasNext()) { ! Element subnode = (Element) joinedsubclassnodes.next(); ! // PersistentClass superModel = getSuperclass( mappings, subnode ); ! // handleJoinedSubclass( superModel, mappings, subnode, ! // inheritedMetas ); ! } ! Iterator unionsubclassnodes = hmNode.elementIterator("union-subclass"); ! while (unionsubclassnodes.hasNext()) { ! Element subnode = (Element) unionsubclassnodes.next(); ! // PersistentClass superModel = getSuperclass( mappings, subnode ); ! // handleUnionSubclass( superModel, mappings, subnode, ! // inheritedMetas ); ! } ! nodes = hmNode.elementIterator("query"); ! while (nodes.hasNext()) { ! bindNamedQuery((Element) nodes.next(), null, mappings); ! } ! nodes = hmNode.elementIterator("sql-query"); ! while (nodes.hasNext()) { ! bindNamedSQLQuery((Element) nodes.next(), null, mappings); ! } ! nodes = hmNode.elementIterator("resultset"); ! while (nodes.hasNext()) { ! bindResultSetMappingDefinition((Element) nodes.next(), null, ! mappings); ! } ! nodes = hmNode.elementIterator("import"); ! while (nodes.hasNext()) { ! Element n = (Element) nodes.next(); ! String className = getClassName(n.attribute("class"), mappings); ! Attribute renameNode = n.attribute("rename"); ! String rename = (renameNode == null) ? StringHelper ! .unqualify(className) : renameNode.getValue(); ! log.debug("Import: " + rename + " -> " + className); ! mappings.addImport(className, rename); ! } ! nodes = hmNode.elementIterator("database-object"); ! while (nodes.hasNext()) { ! Element auxDbObjectNode = (Element) nodes.next(); ! AuxiliaryDatabaseObject auxDbObject = null; ! Element definitionNode = auxDbObjectNode.element("definition"); ! if (definitionNode != null) { ! try { ! auxDbObject = (AuxiliaryDatabaseObject) ReflectHelper ! .classForName( ! definitionNode.attributeValue("class")) ! .newInstance(); ! } catch (ClassNotFoundException e) { ! throw new MappingException( ! "could not locate custom database object class [" ! + definitionNode.attributeValue("class") ! + "]"); ! } catch (Throwable t) { ! throw new MappingException( ! "could not instantiate custom database object class [" ! + definitionNode.attributeValue("class") ! + "]"); ! } ! } else { ! auxDbObject = new SimpleAuxiliaryDatabaseObject(auxDbObjectNode ! .elementTextTrim("create"), auxDbObjectNode ! .elementTextTrim("drop")); ! } ! Iterator dialectScopings = auxDbObjectNode ! .elementIterator("dialect-scope"); ! while (dialectScopings.hasNext()) { ! Element dialectScoping = (Element) dialectScopings.next(); ! auxDbObject.addDialectScope(dialectScoping ! .attributeValue("name")); ! } ! mappings.addAuxiliaryDatabaseObject(auxDbObject); ! } ! } ! } \ No newline at end of file --- 25,238 ---- * metamodel (the classes in the <tt>mapping</tt> package) */ ! public final class SnmapBinder ! { ! private static final Log log = LogFactory.getLog( SnmapBinder.class ); ! /** ! * Private constructor to disallow instantiation. ! */ ! private SnmapBinder() ! {} ! /** ! * The main contract into the hbm.xml-based binder. Performs necessary ! * binding operations represented by the given DOM. ! * ! * @param doc ! * The DOM to be parsed and bound. ! * @param mappings ! * Current bind state. ! * @param inheritedMetas ! * Any inherited meta-tag information. ! * @throws MappingException ! */ ! public static void bindRoot( Document doc, Mappings mappings, java.util.Map inheritedMetas ) ! throws MappingException ! { ! // Get extend information (package) ! SnmapBinder.getExtendsNeeded( doc, mappings ); ! Element hmNode = doc.getRootElement(); ! Iterator nodes = hmNode.elementIterator( "class" ); ! while( nodes.hasNext() ) ! { ! Element n = (Element) nodes.next(); ! RootClass rootclass = new RootClass(); ! bindRootClass( n, rootclass, mappings, inheritedMetas ); ! mappings.addClass( rootclass ); ! } ! } ! /** ! * Responsible for perfoming the bind operation related to an <class/> ! * mapping element. ! * ! * @param node ! * The DOM Element for the <class/> element. ! * @param rootClass ! * The mapping instance to which to bind the information. ! * @param mappings ! * The current bind state. ! * @param inheritedMetas ! * Any inherited meta-tag information. ! * @throws MappingException ! */ ! public static void bindRootClass( Element node, RootClass rootClass, Mappings mappings, ! java.util.Map inheritedMetas ) throws MappingException ! { ! bindClass( node, rootClass, mappings, inheritedMetas ); ! bindRootPersistentClassCommonValues( node, inheritedMetas, mappings, rootClass ); ! } ! private static void bindRootPersistentClassCommonValues( Element node, ! java.util.Map inheritedMetas, Mappings mappings, RootClass entity ) throws MappingException ! { ! Iterator subnodes = node.elementIterator(); ! while( subnodes.hasNext() ) ! { ! Element subnode = (Element) subnodes.next(); ! String name = subnode.getName(); ! // TODO : check Table? ! if ("table".equals(name)) { ! } ! } ! createClassProperties( node, entity, mappings, inheritedMetas ); ! } ! public static void getExtendsNeeded( Document doc, Mappings mappings ) ! { ! final Element hmNode = doc.getRootElement(); ! Attribute packNode = hmNode.attribute( "package" ); ! if( packNode != null ) ! mappings.setDefaultPackage( packNode.getValue() ); ! } ! public static void bindClass( Element node, PersistentClass persistentClass, Mappings mappings, ! java.util.Map inheritedMetas ) throws MappingException ! { ! bindPojoRepresentation( node, persistentClass, mappings, inheritedMetas ); ! } ! protected static void createClassProperties( Element node, PersistentClass persistentClass, ! Mappings mappings, java.util.Map inheritedMetas ) throws MappingException ! { ! createClassProperties( node, persistentClass, mappings, inheritedMetas, true, true ); ! } ! protected static void createClassProperties( Element node, PersistentClass persistentClass, ! Mappings mappings, java.util.Map inheritedMetas, boolean mutable, boolean nullable ) ! throws MappingException ! { ! Iterator iter = node.elementIterator(); ! while( iter.hasNext() ) ! { ! Element subnode = (Element) iter.next(); ! String name = subnode.getName(); ! String propertyName = subnode.attributeValue( "name" ); ! ! Value value = null; ! ! if( "property".equals( name ) ) ! { ! value = new SimpleValue(); ! bindSimpleValue( subnode, (SimpleValue) value, nullable, propertyName, mappings ); ! } ! if( value != null ) ! { ! Property property = createProperty( value, propertyName, persistentClass ! .getClassName(), subnode, mappings, inheritedMetas ); ! persistentClass.addProperty( property ); ! } ! } ! } ! private static void bindPojoRepresentation( Element node, PersistentClass entity, ! Mappings mappings, java.util.Map metaTags ) ! { ! ! String className = getClassName( node.attribute( "name" ), mappings ); ! entity.setClassName( className ); ! } ! ! private static String getClassName( Attribute att, Mappings model ) ! { ! if( att == null ) ! return null; ! return getClassName( att.getValue(), model ); ! } ! ! private static String getClassName( String unqualifiedName, Mappings model ) ! { ! if( unqualifiedName == null ) ! return null; ! if( unqualifiedName.indexOf( '.' ) < 0 && model.getDefaultPackage() != null ) ! { ! return model.getDefaultPackage() + '.' + unqualifiedName; ! } ! return unqualifiedName; ! } ! ! private static Property createProperty( final Value value, final String propertyName, ! final String className, final Element subnode, final Mappings mappings, ! java.util.Map inheritedMetas ) throws MappingException ! { ! value.setTypeUsingReflection( className, propertyName ); ! ! Property prop = new Property(); ! prop.setValue( value ); ! bindProperty( subnode, prop, mappings, inheritedMetas ); ! return prop; ! } ! ! ! // automatically makes a ?? with OID ! public static void bindSimpleValue(Element node, SimpleValue simpleValue, boolean isNullable, ! String path, Mappings mappings) throws MappingException { ! bindOid( node, simpleValue, isNullable, path, mappings ); ! } ! ! ! public static void bindProperty( Element node, Property property, Mappings mappings, ! java.util.Map inheritedMetas ) throws MappingException ! { ! String propName = node.attributeValue( "name" ); ! property.setName( propName ); ! } ! ! public static void bindOid(final Element node, final SimpleValue simpleValue, ! final boolean isNullable, final String propertyPath, ! final Mappings mappings) throws MappingException { ! // OID ! Attribute oidAttribute = node.attribute( "oid" ); ! if ( oidAttribute == null ) { ! throw new MappingException( ! "oid attribute should not be null." ); ! } ! else { ! ObjectType objectType = new ObjectType(); ! objectType.setValue( simpleValue ); ! bindObjectType( node, objectType, isNullable ); ! ! simpleValue.setObjectType(objectType); ! ! } ! ! } ! public static void bindObjectType(Element node, ObjectType objectType, boolean isNullable) { ! Attribute oidNode = node.attribute( "oid" ); ! if ( oidNode != null ) ! { ! OID oid = new OID(oidNode.getValue()); ! objectType.setOid(oid); ! } ! } ! } |
|
From: arden l. <ar...@us...> - 2006-01-13 03:23:35
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7630/src/net/sf/snmap/mapping Added Files: ObjectType.java Log Message: --- NEW FILE: ObjectType.java --- package net.sf.snmap.mapping; import java.io.Serializable; import net.sf.snmap.mib.Access; import org.snmp4j.smi.OID; /** * <b>Description:</b> ObjectType is similar to org.hibernate.mapping.Column<br> * In SNMP difinition, ObjectType includes ACCESS and STATUS information, which * will not support in first release. */ public class ObjectType implements Serializable { private static final long serialVersionUID = 1876350735354296156L; private OID oid; private Value value; private Access access; public ObjectType() { }; 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 Access getAccess() { return access; } public void setAccess( Access access ) { this.access = access; } } |
|
From: arden l. <ar...@us...> - 2006-01-13 03:22:57
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7540/src/net/sf/snmap/mapping Modified Files: Property.java Log Message: Index: Property.java =================================================================== RCS file: /cvsroot/snmap/SNMAP/src/net/sf/snmap/mapping/Property.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Property.java 5 Jan 2006 03:58:09 -0000 1.2 --- Property.java 13 Jan 2006 03:22:46 -0000 1.3 *************** *** 5,10 **** import org.snmp4j.smi.OID; - import net.sf.snmap.mib.Access; - public class Property implements Serializable { --- 5,8 ---- *************** *** 12,20 **** private String name; - private OID oid; - private Access access; - - // TODO: from hibernate. private PersistentClass persistentClass; public String getName() --- 10,18 ---- private String name; private PersistentClass persistentClass; + private Value value; + + // TODO : I have not used oid. + private OID oid; public String getName() *************** *** 28,59 **** } ! public OID getOid() ! { ! return oid; } ! public void setOid( OID oid ) ! { ! this.oid = oid; } ! public Access getAccess() { ! return access; } ! public void setAccess( Access access ) { ! this.access = access; } - ! // TODO : From hibernate. ! public PersistentClass getPersistentClass() { ! return persistentClass; } ! public void setPersistentClass(PersistentClass persistentClass) { ! this.persistentClass = persistentClass; } } --- 26,56 ---- } ! 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; } } |
|
From: arden l. <ar...@us...> - 2006-01-13 03:22:43
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7500/src/net/sf/snmap/mapping Added Files: SimpleValue.java Log Message: --- NEW FILE: SimpleValue.java --- package net.sf.snmap.mapping; import org.snmp4j.smi.OID; import net.sf.snmap.MappingException; import net.sf.snmap.util.ReflectHelper; /** * 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; } } |
|
From: arden l. <ar...@us...> - 2006-01-13 03:22:18
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7457/src/net/sf/snmap/mapping Added Files: KeyValue.java Log Message: --- NEW FILE: KeyValue.java --- package net.sf.snmap.mapping; public interface KeyValue extends Value { } |
|
From: arden l. <ar...@us...> - 2006-01-13 03:21:38
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7365/src/net/sf/snmap/mapping Added Files: Value.java Log Message: --- NEW FILE: Value.java --- package net.sf.snmap.mapping; import java.io.Serializable; import net.sf.snmap.MappingException; public interface Value extends Serializable { public boolean isSimpleValue(); public void setTypeUsingReflection(String className, String propertyName) throws MappingException; } |