-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement new JNIField accessor model: allow support for separate get…
…ter/setter methods for individual fields.
- Loading branch information
1 parent
5f52fee
commit 8f464d0
Showing
8 changed files
with
150 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
hawtjni-generator/src/main/java/org/fusesource/hawtjni/generator/model/JNIFieldAccessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.fusesource.hawtjni.generator.model; | ||
|
||
/** | ||
* @author <a href="mailto:calin.iorgulescu@gmail.com">Calin Iorgulescu</a> | ||
*/ | ||
public interface JNIFieldAccessor { | ||
public String getter(); | ||
|
||
public String setter(); | ||
|
||
public boolean isNonMemberGetter(); | ||
|
||
public boolean isNonMemberSetter(); | ||
|
||
public boolean isMethodGetter(); | ||
|
||
public boolean isMethodSetter(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...-generator/src/main/java/org/fusesource/hawtjni/generator/model/ReflectFieldAccessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package org.fusesource.hawtjni.generator.model; | ||
|
||
/** | ||
* @author <a href="mailto:calin.iorgulescu@gmail.com">Calin Iorgulescu</a> | ||
*/ | ||
public class ReflectFieldAccessor implements JNIFieldAccessor { | ||
|
||
private String getter; | ||
private String setter; | ||
private boolean nonMemberGetter; | ||
private boolean nonMemberSetter; | ||
|
||
public ReflectFieldAccessor(String value) { | ||
this.getter = this.setter = value; | ||
this.nonMemberGetter = this.nonMemberSetter = false; | ||
} | ||
|
||
public ReflectFieldAccessor(String getter, boolean nonMemberGetter, String setter, boolean nonMemberSetter) { | ||
this.getter = getter; | ||
this.nonMemberGetter = nonMemberGetter; | ||
this.setter = setter; | ||
this.nonMemberSetter = nonMemberSetter; | ||
} | ||
|
||
public String getter() { | ||
return getter; | ||
} | ||
|
||
public String setter() { | ||
return setter; | ||
} | ||
|
||
public boolean isNonMemberGetter() { | ||
return nonMemberGetter; | ||
} | ||
|
||
public boolean isNonMemberSetter() { | ||
return nonMemberSetter; | ||
} | ||
|
||
public boolean isMethodGetter() { | ||
return getter.contains("("); | ||
} | ||
|
||
public boolean isMethodSetter() { | ||
return setter.contains("("); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters