/** * Computes the namespace URI -> package name conversion * as specified by the JAXB spec. * * @param namespaceUri * Namespace URI. Can be empty, but must not be null. * @return * A Java package name (e.g., "foo.bar"). "" to represent the root package. * This method returns null if the method fails to derive the package name * (there are certain namespace URIs with which this algorithm does not * work --- such as ":::" as the URI.) */ public static String getDefaultPackageName( String namespaceUri ) { if(namespaceUri==null) throw new IllegalArgumentException(); return NameConverter.standard.toPackageName( namespaceUri ); } }
/** * Computes the namespace {@code URI -> package name} conversion * as specified by the JAXB spec. * * @param namespaceUri * Namespace URI. Can be empty, but must not be null. * @return * A Java package name (e.g., "foo.bar"). "" to represent the root package. * This method returns null if the method fails to derive the package name * (there are certain namespace URIs with which this algorithm does not * work --- such as ":::" as the URI.) */ public static String getDefaultPackageName( String namespaceUri ) { if(namespaceUri==null) throw new IllegalArgumentException(); return NameConverter.standard.toPackageName( namespaceUri ); } }
/** * Computes the namespace {@code URI -> package name} conversion * as specified by the JAXB spec. * * @param namespaceUri * Namespace URI. Can be empty, but must not be null. * @return * A Java package name (e.g., "foo.bar"). "" to represent the root package. * This method returns null if the method fails to derive the package name * (there are certain namespace URIs with which this algorithm does not * work --- such as ":::" as the URI.) */ public static String getDefaultPackageName( String namespaceUri ) { if(namespaceUri==null) throw new IllegalArgumentException(); return NameConverter.standard.toPackageName( namespaceUri ); } }
/** * Computes the namespace {@code URI -> package name} conversion * as specified by the JAXB spec. * * @param namespaceUri * Namespace URI. Can be empty, but must not be null. * @return * A Java package name (e.g., "foo.bar"). "" to represent the root package. * This method returns null if the method fails to derive the package name * (there are certain namespace URIs with which this algorithm does not * work --- such as ":::" as the URI.) */ public static String getDefaultPackageName( String namespaceUri ) { if(namespaceUri==null) throw new IllegalArgumentException(); return NameConverter.standard.toPackageName( namespaceUri ); } }
/** * Computes the namespace URI -> package name conversion * as specified by the JAXB spec. * * @param namespaceUri * Namespace URI. Can be empty, but must not be null. * @return * A Java package name (e.g., "foo.bar"). "" to represent the root package. * This method returns null if the method fails to derive the package name * (there are certain namespace URIs with which this algorithm does not * work --- such as ":::" as the URI.) */ public static String getDefaultPackageName( String namespaceUri ) { if(namespaceUri==null) throw new IllegalArgumentException(); return NameConverter.standard.toPackageName( namespaceUri ); } }
protected String toNamespace(String urlString) { NameConverter nameConverter = new NameConverter.Standard(); return nameConverter.toPackageName(urlString); } }
/* Also available in the internal package space as part of the JDK */ import com.sun.xml.bind.api.impl.NameConverter; public static String convertToPackageName(String xmlNamespace) { NameConverter nameConverter = new NameConverter.Standard(); return nameConverter.toPackageName(xmlNamespace); }
String javaInterface = NameConverter.standard.toPackageName(qname.getNamespaceURI()) + '.' + Character.toUpperCase(localPart.charAt(0)) + localPart.substring(1); log.info("The Java interface for '" + wsdlInterface + "' is " + javaInterface);
String objectFactoryClassName = NameConverter.standard.toPackageName(definition.getTargetNamespace()) + ".ObjectFactory"; processingContext.loadClass(objectFactoryClassName);
name = builder.getNameConverter().toPackageName( targetNamespace );
name = builder.getNameConverter().toPackageName( targetNamespace );
name = builder.getNameConverter().toPackageName( targetNamespace );
name = builder.getNameConverter().toPackageName( targetNamespace );
name = builder.getNameConverter().toPackageName( targetNamespace );