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
object ATR extends AbstractTypeResolver { | |
override def findTypeMapping(config: DeserializationConfig, javaType: JavaType) = { | |
val result = Some(javaType) collect { | |
case mapLikeType: MapLikeType => | |
if (javaType.getRawClass.equals(classOf[collection.Map[_, _]])) { | |
TypeFactory.defaultInstance().constructSpecializedType(javaType, classOf[mutable.LinkedHashMap[_, _]]) | |
} else null | |
case colType: CollectionLikeType => | |
if (javaType.getRawClass.equals(classOf[collection.Seq[_]])) { | |
TypeFactory.defaultInstance().constructSpecializedType(javaType, classOf[mutable.LinearSeq[_]]) |
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 class PasswordCallback implements CallbackHandler { | |
private Map<String, String> passwords; | |
public PasswordCallback(String username, String password) { | |
password.put(username, password); | |
} | |
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallBackException { | |
for (int = 0; i < callbacks.length; i++) { | |
WSPasswordCallback pc = (WSPasswordCallback) callbacks[i]; |
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
%dw 1.0 | |
%output application/json | |
--- | |
{ | |
result: [ | |
payload.person.firstName, | |
payload.person.middleName, | |
payload.person.lastName | |
] | |
filter $ != null |
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
%dw 1.0 | |
%output application/xml | |
--- | |
{ | |
result: payload filter ($ != null and $ != '' or $$ == 'someSpecificField') | |
} |
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
%dw 1.0 | |
%output application/json | |
--- | |
{ | |
result: payload[payload.someField] | |
} |
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
%dw 1.0 | |
%output application/xml | |
--- | |
{ | |
mergedArray: (arrayWithNewValues ++ arrayWithOldValues) distinctBy $.id | |
} |