All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.virtualan.api.WSResource Maven / Gradle / Ivy

package io.virtualan.api;

import java.lang.reflect.Method;
import java.util.AbstractMap;
import org.springframework.stereotype.Component;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;


@Component
public class WSResource {

  private WSResource(){
  }

  public static boolean isExists(Method method) {
    PayloadRoot a = method.getAnnotation(PayloadRoot.class);
    return  a != null;
  }

  public static AbstractMap.SimpleEntry getResourceParent(Method method) {
    PayloadRoot a = method.getAnnotation(PayloadRoot.class);
    String part = a.localPart();
    String ns = a.namespace().contains("}")  ?  a.namespace().replace("}","").replace("{","") : a.namespace() ;
    return new AbstractMap.SimpleEntry<>(part, ns);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy