Last active
December 17, 2015 20:29
-
-
Save jamalsa/5668404 to your computer and use it in GitHub Desktop.
Contoh sintaks sederhana parsing rule common message baru. Fitur yang sudah ada baru parse object ke string sederhana.
This file contains hidden or 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
@Entity(fieldOrder={"switcherId", "idpel"}) | |
class TestObject | |
{ | |
@Element(length=7) | |
public String switcherId; | |
@Element(length=15, padding=AdditionalFieldPadLocation.LEFT, paddingChar='0') | |
protected String idpel; | |
public String getIdpel() { | |
return idpel; | |
} | |
public void setIdpel(String idpel) { | |
this.idpel = idpel; | |
} | |
} | |
// Contoh Inheritance | |
@Entity(fieldOrder={"switcherId", "kodeArea", "idpel"}) | |
class TestObject2 extends TestObject1 | |
{ | |
@Element(length=7) | |
public String kodeArea; | |
} | |
ObjectParser tParser = new ObjectParser(); | |
TestObject tObject = new TestObject(); | |
tObject.switcherId = "VI105V3"; | |
tObject.setIdpel("5300000001"); | |
System.out.println("Parsed object:" + tParser.parseObject(tObject)); // Menampilkan "VI105V3 5300000001" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tipe class property yang sudah disupport:
Mensupport public property dan private/protected property (dengan setter dan getter).
To Do: