Created
July 13, 2015 13:15
-
-
Save jurasseck/552460b7315e6d554db1 to your computer and use it in GitHub Desktop.
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
public String getIntegrationHeader() { | |
StringBuilder header = new StringBuilder(); | |
for (Field field : getClass().getDeclaredFields()) { | |
if (field.isAnnotationPresent(IntegraTalisma.class)) { | |
header.append(field.getName()).append(FIELD_SEPARATOR); | |
} | |
} | |
return header.toString().substring(0, header.length() - 1) + QUEBRA_LINHA; | |
} | |
public String getIntegrationContent() throws IllegalArgumentException, IllegalAccessException { | |
StringBuilder content = new StringBuilder(); | |
for (Field field : getClass().getDeclaredFields()) { | |
if (field.isAnnotationPresent(IntegraTalisma.class)) { | |
field.setAccessible(true); | |
content.append((Object) field.get(this)).append(FIELD_SEPARATOR); | |
} | |
} | |
return content.toString().substring(0, content.length() - 1) + QUEBRA_LINHA; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment