Skip to content

Commit cb32674

Browse files
laurentschoelensmattrpav
authored andcommitted
[#606] remove spring + [#613] make maxIdentifierLength configurable + [#615] custom naming example fix
1 parent c8a999e commit cb32674

File tree

47 files changed

+1059
-1006
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1059
-1006
lines changed

hyperjaxb/ejb/extensions/naming/custom-naming-pre_0_6_0/src/main/resources/org/jvnet/hyperjaxb3/ejb/plugin/custom/applicationContext.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.

hyperjaxb/ejb/extensions/naming/custom-naming-pre_0_6_0/pom.xml renamed to hyperjaxb/ejb/extensions/naming/custom-naming/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<version>4.0.10-SNAPSHOT</version>
77
<relativePath>../pom.xml</relativePath>
88
</parent>
9-
<artifactId>hyperjaxb3-ejb-extensions-custom-naming-pre_0_6_0</artifactId>
9+
<artifactId>hyperjaxb3-ejb-extensions-custom-naming</artifactId>
1010
<packaging>jar</packaging>
11-
<name>JAXB Tools :: Hyperjaxb3 :: EJB :: Extensions :: Naming [custom-naming-pre_0_6_0]</name>
11+
<name>JAXB Tools :: Hyperjaxb3 :: EJB :: Extensions :: Naming [custom-naming]</name>
1212

1313
<dependencies>
1414
<dependency>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package org.jvnet.hyperjaxb3.ejb.extensions.naming.impl;
2+
3+
import org.jvnet.hyperjaxb3.ejb.IApplicationContext;
4+
import org.jvnet.hyperjaxb3.ejb.strategy.ignoring.Ignoring;
5+
import org.jvnet.hyperjaxb3.ejb.strategy.naming.impl.DefaultNaming;
6+
7+
import java.util.Properties;
8+
9+
public class CustomApplicationContext implements IApplicationContext {
10+
11+
@Override
12+
public DefaultNaming createNaming(Ignoring ignoring, Properties reservedNames) {
13+
return new CustomSimpleNoUnderscoreNaming(ignoring, reservedNames);
14+
}
15+
}
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
package org.jvnet.hyperjaxb3.ejb.extensions.naming.pre_0_6_0.impl;
1+
package org.jvnet.hyperjaxb3.ejb.extensions.naming.impl;
22

3+
import org.jvnet.hyperjaxb3.ejb.strategy.ignoring.Ignoring;
34
import org.jvnet.hyperjaxb3.ejb.strategy.mapping.Mapping;
45
import org.jvnet.hyperjaxb3.ejb.strategy.naming.impl.DefaultNaming;
56

7+
import java.util.Properties;
8+
69
public class CustomSimpleNoUnderscoreNaming extends DefaultNaming {
7-
10+
11+
public CustomSimpleNoUnderscoreNaming(Ignoring ignoring, Properties reservedNames) {
12+
super(ignoring, reservedNames);
13+
}
14+
815
@Override
916
public String getName(Mapping context, final String draftName) {
1017
String name = super.getName(context, draftName);

hyperjaxb/ejb/extensions/naming/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
<name>JAXB Tools :: Hyperjaxb3 :: EJB :: Extensions :: Naming</name>
1212

1313
<modules>
14-
<module>custom-naming-pre_0_6_0</module>
14+
<module>custom-naming</module>
1515
</modules>
1616
</project>

hyperjaxb/ejb/plugin/pom.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@
2727
<groupId>org.jvnet.jaxb</groupId>
2828
<artifactId>jaxb-plugins-tools</artifactId>
2929
</dependency>
30-
<dependency>
31-
<groupId>org.springframework</groupId>
32-
<artifactId>spring-context</artifactId>
33-
</dependency>
34-
<dependency>
35-
<groupId>org.springframework</groupId>
36-
<artifactId>spring-beans</artifactId>
37-
</dependency>
3830
<dependency>
3931
<groupId>org.jvnet.jaxb</groupId>
4032
<artifactId>hyperjaxb3-ejb-roundtrip</artifactId>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package org.jvnet.hyperjaxb3.beans.factory;
2+
3+
import java.util.Map;
4+
5+
import jakarta.xml.bind.JAXBContext;
6+
7+
public class JAXBContextFactory {
8+
9+
public static JAXBContext createInstance(String contextPath) throws Exception {
10+
return JAXBContext.newInstance(contextPath);
11+
}
12+
13+
public static JAXBContext createInstance(String contextPath, ClassLoader classLoader) throws Exception {
14+
return JAXBContext.newInstance(contextPath, classLoader);
15+
}
16+
17+
public static JAXBContext createInstance(String contextPath, Map<String, ?> properties) throws Exception {
18+
return JAXBContext.newInstance(contextPath, Thread.currentThread().getContextClassLoader(), properties);
19+
}
20+
21+
public static JAXBContext createInstance(String contextPath, ClassLoader classLoader, Map<String, ?> properties) throws Exception {
22+
return JAXBContext.newInstance(contextPath, classLoader, properties);
23+
}
24+
}

hyperjaxb/ejb/plugin/src/main/java/org/jvnet/hyperjaxb3/beans/factory/JAXBContextFactoryBean.java

Lines changed: 0 additions & 68 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package org.jvnet.hyperjaxb3.beans.factory;
2+
3+
import java.io.InputStream;
4+
5+
import jakarta.xml.bind.JAXBContext;
6+
import jakarta.xml.bind.JAXBElement;
7+
8+
import org.xml.sax.InputSource;
9+
10+
public class UnmarshalledResourceFactory {
11+
12+
public static Object createInstance(InputStream stream, String systemId, JAXBContext context) throws Exception {
13+
final InputSource inputSource = new InputSource(stream);
14+
inputSource.setSystemId(systemId);
15+
final Object unmarshallingResult = context.createUnmarshaller().unmarshal(inputSource);
16+
if (unmarshallingResult instanceof JAXBElement<?>) {
17+
return ((JAXBElement<?>) unmarshallingResult).getValue();
18+
} else {
19+
return unmarshallingResult;
20+
}
21+
}
22+
}

hyperjaxb/ejb/plugin/src/main/java/org/jvnet/hyperjaxb3/beans/factory/UnmarshalledResourceFactoryBean.java

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)