forked from emigonza/JavaPOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBumpBarBeanInfo.java
More file actions
108 lines (98 loc) · 3.21 KB
/
Copy pathBumpBarBeanInfo.java
File metadata and controls
108 lines (98 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
//------------------------------------------------------------------------------
//
// THIS SOFTWARE IS PROVIDED AS IS. THE JAVAPOS WORKING GROUP MAKES NO
// REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE,
// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
// NON-INFRINGEMENT. INDIVIDUAL OR CORPORATE MEMBERS OF THE JAVAPOS
// WORKING GROUP SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED AS A RESULT
// OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
//
// BumpBarBeanInfo.java - Bean information for the JavaPOS BumpBar
// device control
//
//------------------------------------------------------------------------------
package jpos;
import java.beans.*;
import java.lang.reflect.*;
public class BumpBarBeanInfo
extends SimpleBeanInfo
{
public BeanDescriptor getBeanDescriptor()
{
return new BeanDescriptor(jpos.BumpBar.class);
}
public PropertyDescriptor makeProperty(String propertyName)
throws IntrospectionException
{
return new PropertyDescriptor(propertyName, jpos.BumpBar.class);
}
public PropertyDescriptor[] getPropertyDescriptors()
{
try
{
PropertyDescriptor[] properties =
{
// Capabilities
makeProperty("CapPowerReporting"),
makeProperty("CapTone"),
makeProperty("CapStatisticsReporting"),
makeProperty("CapUpdateStatistics"),
makeProperty("CapCompareFirmwareVersion"),
makeProperty("CapUpdateFirmware"),
// Properties
makeProperty("AsyncMode"),
makeProperty("AutoToneDuration"),
makeProperty("AutoToneFrequency"),
makeProperty("BumpBarDataCount"),
makeProperty("CurrentUnitID"),
makeProperty("DataCount"),
makeProperty("DataEventEnabled"),
makeProperty("ErrorString"),
makeProperty("ErrorUnits"),
makeProperty("EventString"),
makeProperty("EventUnitID"),
makeProperty("EventUnits"),
makeProperty("Keys"),
makeProperty("OutputID"),
makeProperty("PowerNotify"),
makeProperty("PowerState"),
makeProperty("Timeout"),
makeProperty("UnitsOnline")
};
return properties;
}
catch(Exception e)
{
return super.getPropertyDescriptors();
}
}
public EventSetDescriptor makeEvent(String eventName)
throws IntrospectionException, ClassNotFoundException
{
String listener = "jpos.events." + eventName + "Listener";
return new EventSetDescriptor(jpos.BumpBar.class,
eventName,
Class.forName(listener),
eventName + "Occurred");
}
public EventSetDescriptor[] getEventSetDescriptors()
{
try
{
EventSetDescriptor[] events =
{
makeEvent("Data"),
makeEvent("DirectIO"),
makeEvent("Error"),
makeEvent("OutputComplete"),
makeEvent("StatusUpdate")
};
return events;
}
catch(Exception e)
{
return super.getEventSetDescriptors();
}
}
}