Author: alessio.soldano(a)jboss.com
Date: 2009-10-08 05:18:25 -0400 (Thu, 08 Oct 2009)
New Revision: 10856
Modified:
projects/jaxbintros/trunk/src/main/java/org/jboss/jaxb/intros/BindingCustomizationFactory.java
Log:
[JBAS-7319] Adding another convenient method to BindingCustomizationFactory
Modified:
projects/jaxbintros/trunk/src/main/java/org/jboss/jaxb/intros/BindingCustomizationFactory.java
===================================================================
---
projects/jaxbintros/trunk/src/main/java/org/jboss/jaxb/intros/BindingCustomizationFactory.java 2009-10-07
17:24:32 UTC (rev 10855)
+++
projects/jaxbintros/trunk/src/main/java/org/jboss/jaxb/intros/BindingCustomizationFactory.java 2009-10-08
09:18:25 UTC (rev 10856)
@@ -41,22 +41,33 @@
*/
public class BindingCustomizationFactory
{
- public static Map<String, Object> getBindingCustomization(InputStream
introsConfigStream)
- {
- return getBindingCustomization(introsConfigStream, null);
- }
-
- public static Map<String, Object> getBindingCustomization(InputStream
introsConfigStream, String namespace)
- {
- JaxbIntros jaxbIntros =
IntroductionsConfigParser.parseConfig(introsConfigStream);
- IntroductionsAnnotationReader annotationReader = new
IntroductionsAnnotationReader(jaxbIntros);
- String defaultNamespace = namespace != null ? namespace :
jaxbIntros.getDefaultNamespace();
- Map<String, Object> jaxbCustomizations = new HashMap<String,
Object>();
+ public static Map<String, Object> getBindingCustomization(InputStream
introsConfigStream)
+ {
+ return getBindingCustomization(introsConfigStream, null);
+ }
- jaxbCustomizations.put(JAXBRIContext.ANNOTATION_READER, annotationReader);
- if(defaultNamespace != null) {
- jaxbCustomizations.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP,
defaultNamespace);
- }
- return jaxbCustomizations;
- }
+ public static Map<String, Object> getBindingCustomization(InputStream
introsConfigStream, String namespace)
+ {
+ Map<String, Object> jaxbCustomizations = new HashMap<String,
Object>();
+ populateBindingCustomization(introsConfigStream, namespace, jaxbCustomizations);
+ return jaxbCustomizations;
+ }
+
+ public static void populateBindingCustomization(InputStream introsConfigStream,
Map<String, Object> customization)
+ {
+ populateBindingCustomization(introsConfigStream, null, customization);
+ }
+
+ public static void populateBindingCustomization(InputStream introsConfigStream, String
namespace, Map<String, Object> customization)
+ {
+ JaxbIntros jaxbIntros = IntroductionsConfigParser.parseConfig(introsConfigStream);
+ IntroductionsAnnotationReader annotationReader = new
IntroductionsAnnotationReader(jaxbIntros);
+ String defaultNamespace = namespace != null ? namespace :
jaxbIntros.getDefaultNamespace();
+
+ customization.put(JAXBRIContext.ANNOTATION_READER, annotationReader);
+ if (defaultNamespace != null)
+ {
+ customization.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP, defaultNamespace);
+ }
+ }
}
Show replies by date