use of org.apache.cxf.aegis.type.DefaultTypeMapping in project cxf by apache.
the class XFireXmlParamTypeTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
tm = new DefaultTypeMapping(null, DefaultTypeMapping.createDefaultTypeMapping(false, false));
creator = new Java5TypeCreator();
creator.setNextCreator(new DefaultTypeCreator());
creator.setConfiguration(new org.apache.cxf.aegis.type.TypeCreationOptions());
tm.setTypeCreator(creator);
}
use of org.apache.cxf.aegis.type.DefaultTypeMapping in project cxf by apache.
the class XmlParamTypeTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
tm = new DefaultTypeMapping(null, DefaultTypeMapping.createDefaultTypeMapping(false, false));
creator = new Java5TypeCreator();
creator.setNextCreator(new DefaultTypeCreator());
creator.setConfiguration(new TypeCreationOptions());
tm.setTypeCreator(creator);
}
use of org.apache.cxf.aegis.type.DefaultTypeMapping in project cxf by apache.
the class XMLStreamReaderMappingTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
addNamespace("b", "urn:beanz");
addNamespace("xsi", Constants.URI_2001_SCHEMA_XSI);
context = new AegisContext();
// create a different mapping than the context creates.
TypeMapping baseMapping = DefaultTypeMapping.createSoap11TypeMapping(true, false, false);
mapping = new DefaultTypeMapping(Constants.URI_2001_SCHEMA_XSD, baseMapping);
mapping.register(XMLStreamReader.class, new QName("urn:Bean", "SimpleBean"), new XMLStreamReaderType());
mapping.setTypeCreator(context.createTypeCreator());
context.setTypeMapping(mapping);
context.initialize();
}
use of org.apache.cxf.aegis.type.DefaultTypeMapping in project cxf by apache.
the class AegisContext method initialize.
/**
* Initialize the context. The encodingStyleURI allows .aegis.xml files to have multiple mappings for,
* say, SOAP 1.1 versus SOAP 1.2. Passing null uses a default URI.
*
* @param mappingNamespaceURI URI to select mappings based on the encoding.
*/
public void initialize() {
// allow spring config of an alternative mapping.
if (configuration == null) {
configuration = new TypeCreationOptions();
}
if (typeMapping == null) {
boolean defaultNillable = configuration.isDefaultNillable();
TypeMapping baseTM = DefaultTypeMapping.createDefaultTypeMapping(defaultNillable, mtomUseXmime, enableJDOMMappings);
if (mappingNamespaceURI == null) {
mappingNamespaceURI = DefaultTypeMapping.DEFAULT_MAPPING_URI;
}
DefaultTypeMapping defaultTypeMapping = new DefaultTypeMapping(mappingNamespaceURI, baseTM);
defaultTypeMapping.setTypeCreator(createTypeCreator());
typeMapping = defaultTypeMapping;
}
processRootTypes();
}
use of org.apache.cxf.aegis.type.DefaultTypeMapping in project cxf by apache.
the class MapTest method testMapDTO.
@Test
public void testMapDTO() {
tm = new DefaultTypeMapping();
creator = new Java5TypeCreator();
creator.setConfiguration(new TypeCreationOptions());
tm.setTypeCreator(creator);
AegisType dto = creator.createType(MapDTO.class);
Set<AegisType> deps = dto.getDependencies();
AegisType type = deps.iterator().next();
assertTrue(type instanceof MapType);
MapType mapType = (MapType) type;
deps = dto.getDependencies();
assertEquals(1, deps.size());
type = mapType.getKeyType();
assertNotNull(type);
assertTrue(type.getTypeClass().isAssignableFrom(String.class));
type = mapType.getValueType();
assertNotNull(type);
assertTrue(type.getTypeClass().isAssignableFrom(Integer.class));
}
Aggregations