-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObjectProperty.java
More file actions
47 lines (38 loc) · 1.06 KB
/
ObjectProperty.java
File metadata and controls
47 lines (38 loc) · 1.06 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
package sample;
import javax.swing.text.StyledEditorKit;
/**
* Created by Jordan on 09/08/2017.
*/
public class ObjectProperty<Type> {
public Type Value;
private String name;
private Boolean editible;
ObjectProperty(Type Value, String name, Boolean editible){
this.Value = Value;
this.name = name;
this.editible = editible;
}
public String getType(){
String type;
try {
String wholePath = Value.getClass().getTypeName();
String path[] = wholePath.split("\\.");
int length = path.length;
type = path[length-1];
}catch (NullPointerException e){
type = "null";
}catch (ArrayIndexOutOfBoundsException r){
type = "null";
}
return type;
}
public String getName(){
return this.name;
}
public Boolean getEditible(){
return this.editible;
}
public void setEditible(Boolean editible){
this.editible = editible;
}
}