com.sun.xml.bind.util.Which.which()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中com.sun.xml.bind.util.Which.which()方法的一些代码示例,展示了Which.which()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Which.which()方法的具体详情如下:
包路径:com.sun.xml.bind.util.Which
类名称:Which
方法名:which

Which.which介绍

[英]Search the specified classloader for the given classname. Then give the return value.
[中]在指定的类加载器中搜索给定的类名。然后给出返回值。

代码示例

代码示例来源:origin: com.sun.xml.bind/jaxb-impl

@Override
public String toString() {
  StringBuilder buf = new StringBuilder(Which.which(getClass()) + " Build-Id: " + getBuildId());
  buf.append("\nClasses known to this context:\n");
  Set<String> names = new TreeSet<String>();  // sort them so that it's easy to read
  for (Class key : beanInfoMap.keySet())
    names.add(key.getName());
  for(String name: names)
    buf.append("  ").append(name).append('\n');
  return buf.toString();
}

代码示例来源:origin: com.sun.xml.bind/jaxb-impl

public static String which( Class clazz ) {
  return which( clazz.getName(), SecureLoader.getClassClassLoader(clazz));
}

代码示例来源:origin: com.sun.xml.bind/jaxb-impl

Messages.format(Messages.DOM_IMPL_DOESNT_SUPPORT_CREATELEMENTNS,
document.getClass().getName(),
Which.which(document.getClass())));

代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime

@Override
public String toString() {
  StringBuilder buf = new StringBuilder(Which.which(getClass()) + " Build-Id: " + getBuildId());
  buf.append("\nClasses known to this context:\n");
  Set<String> names = new TreeSet<String>();  // sort them so that it's easy to read
  for (Class key : beanInfoMap.keySet())
    names.add(key.getName());
  for(String name: names)
    buf.append("  ").append(name).append('\n');
  return buf.toString();
}

代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime

public static String which( Class clazz ) {
  return which( clazz.getName(), SecureLoader.getClassClassLoader(clazz));
}

代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime

Messages.format(Messages.DOM_IMPL_DOESNT_SUPPORT_CREATELEMENTNS,
document.getClass().getName(),
Which.which(document.getClass())));

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl

@Override
public String toString() {
  StringBuilder buf = new StringBuilder(Which.which(getClass()) + " Build-Id: " + getBuildId());
  buf.append("\nClasses known to this context:\n");
  Set<String> names = new TreeSet<String>();  // sort them so that it's easy to read
  for (Class key : beanInfoMap.keySet())
    names.add(key.getName());
  for(String name: names)
    buf.append("  ").append(name).append('\n');
  return buf.toString();
}

代码示例来源:origin: org.glassfish.jaxb/jaxb-core

public static String which( Class clazz ) {
  return which( clazz.getName(), SecureLoader.getClassClassLoader(clazz));
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public String toString() {
  StringBuilder buf = new StringBuilder(Which.which(getClass()) + " Build-Id: " + getBuildId());
  buf.append("\nClasses known to this context:\n");
  Set<String> names = new TreeSet<String>();  // sort them so that it's easy to read
  for (Class key : beanInfoMap.keySet())
    names.add(key.getName());
  for(String name: names)
    buf.append("  ").append(name).append('\n');
  return buf.toString();
}

代码示例来源:origin: com.sun.xml.bind/jaxb-core

public static String which( Class clazz ) {
  return which( clazz.getName(), SecureLoader.getClassClassLoader(clazz));
}

代码示例来源:origin: org.mule.glassfish.jaxb/jaxb-core

public static String which( Class clazz ) {
  return which( clazz.getName(), SecureLoader.getClassClassLoader(clazz));
}

代码示例来源:origin: apache/servicemix-bundles

public static String which( Class clazz ) {
  return which( clazz.getName(), SecureLoader.getClassClassLoader(clazz));
}

代码示例来源:origin: com.sun.xml.ws/rt

public MessageFactory getMessageFactory() {
  try {
    return SAAJFactory.getMessageFactory(saajFactoryString); 
  } catch (SOAPException e) {
    throw new Error(e);
  } catch (NoSuchMethodError e) {
    // SAAJ 1.3 is not in the classpath
    LinkageError x = new LinkageError("You are loading old SAAJ from "+ Which.which(MessageFactory.class));
    x.initCause(e);
    throw x;
  }
}

代码示例来源:origin: javaee/metro-jax-ws

public MessageFactory getMessageFactory() {
  try {
    return SAAJFactory.getMessageFactory(saajFactoryString); 
  } catch (SOAPException e) {
    throw new Error(e);
  } catch (NoSuchMethodError e) {
    // SAAJ 1.3 is not in the classpath
    LinkageError x = new LinkageError("You are loading old SAAJ from "+ Which.which(MessageFactory.class));
    x.initCause(e);
    throw x;
  }
}

代码示例来源:origin: com.sun.xml.ws/jaxws-rt

public SOAPFactory getSOAPFactory() {
  try {
    return SAAJFactory.getSOAPFactory(saajFactoryString);
  } catch (SOAPException e) {
    throw new Error(e);
  } catch (NoSuchMethodError e) {
    // SAAJ 1.3 is not in the classpath
    LinkageError x = new LinkageError("You are loading old SAAJ from "+ Which.which(MessageFactory.class));
    x.initCause(e);
    throw x;
  }
}

代码示例来源:origin: com.sun.xml.ws/jaxws-rt

public MessageFactory getMessageFactory() {
  try {
    return SAAJFactory.getMessageFactory(saajFactoryString); 
  } catch (SOAPException e) {
    throw new Error(e);
  } catch (NoSuchMethodError e) {
    // SAAJ 1.3 is not in the classpath
    LinkageError x = new LinkageError("You are loading old SAAJ from "+ Which.which(MessageFactory.class));
    x.initCause(e);
    throw x;
  }
}

代码示例来源:origin: com.sun.xml.ws/rt

public SOAPFactory getSOAPFactory() {
  try {
    return SAAJFactory.getSOAPFactory(saajFactoryString);
  } catch (SOAPException e) {
    throw new Error(e);
  } catch (NoSuchMethodError e) {
    // SAAJ 1.3 is not in the classpath
    LinkageError x = new LinkageError("You are loading old SAAJ from "+ Which.which(MessageFactory.class));
    x.initCause(e);
    throw x;
  }
}

代码示例来源:origin: javaee/metro-jax-ws

public SOAPFactory getSOAPFactory() {
  try {
    return SAAJFactory.getSOAPFactory(saajFactoryString);
  } catch (SOAPException e) {
    throw new Error(e);
  } catch (NoSuchMethodError e) {
    // SAAJ 1.3 is not in the classpath
    LinkageError x = new LinkageError("You are loading old SAAJ from "+ Which.which(MessageFactory.class));
    x.initCause(e);
    throw x;
  }
}

代码示例来源:origin: com.sun.xml.ws/jaxws-rt

private SOAPVersion(String httpBindingId, String nsUri, String contentType, String implicitRole, String roleAttributeName,
          String saajFactoryString, QName faultCodeMustUnderstand, String faultCodeClientLocalName,
          String faultCodeServerLocalName,Set<String> requiredRoles) {
  this.httpBindingId = httpBindingId;
  this.nsUri = nsUri;
  this.contentType = contentType;
  this.implicitRole = implicitRole;
  this.implicitRoleSet = Collections.singleton(implicitRole);
  this.roleAttributeName = roleAttributeName;
  this.saajFactoryString = saajFactoryString;
  try {
    saajMessageFactory = MessageFactory.newInstance(saajFactoryString);
    saajSoapFactory = SOAPFactory.newInstance(saajFactoryString);
  } catch (SOAPException e) {
    throw new Error(e);
  } catch (NoSuchMethodError e) {
    // SAAJ 1.3 is not in the classpath
    LinkageError x = new LinkageError("You are loading old SAAJ from "+ Which.which(MessageFactory.class));
    x.initCause(e);
    throw x;
  }
  this.faultCodeMustUnderstand = faultCodeMustUnderstand;
  this.requiredRoles = requiredRoles;
  this.faultCodeClient = new QName(nsUri,faultCodeClientLocalName);
  this.faultCodeServer = new QName(nsUri,faultCodeServerLocalName);
}

代码示例来源:origin: com.sun.xml.ws/jaxws-rt

/**
 * Returns a corresponding feature for a feature annotation(i.e which has
 * {@link WebServiceFeatureAnnotation} meta annotation)
 *
 * @return corresponding feature for the annotation
 *         null, if the annotation is nota feature annotation
 */
public static WebServiceFeature getFeature(Annotation a) {
  WebServiceFeature ftr = null;
  if (!(a.annotationType().isAnnotationPresent(WebServiceFeatureAnnotation.class))) {
    ftr = null;
  } else if (a instanceof Addressing) {
    Addressing addAnn = (Addressing) a;
    try {
      ftr = new AddressingFeature(addAnn.enabled(), addAnn.required(),addAnn.responses());
    } catch(NoSuchMethodError e) {
      //throw error. We can't default to Responses.ALL as we dont know if the user has not used 2.2 annotation with responses.
      throw new RuntimeModelerException(ModelerMessages.RUNTIME_MODELER_ADDRESSING_RESPONSES_NOSUCHMETHOD(toJar(Which.which(Addressing.class))));
    }
  } else if (a instanceof MTOM) {
    MTOM mtomAnn = (MTOM) a;
    ftr = new MTOMFeature(mtomAnn.enabled(), mtomAnn.threshold());
  } else if (a instanceof RespectBinding) {
    RespectBinding rbAnn = (RespectBinding) a;
    ftr = new RespectBindingFeature(rbAnn.enabled());
  } else {
    ftr = getWebServiceFeatureBean(a);
  }
  return ftr;
}

相关文章