Search in sources :

Example 1 with ShortType

use of org.apache.cxf.aegis.type.basic.ShortType in project cxf by apache.

the class DefaultTypeMapping method fillStandardMappings.

private static void fillStandardMappings(TypeMapping tm, boolean defaultNillable, boolean enableMtomXmime, boolean enableJDOM) {
    defaultRegister(tm, defaultNillable, BigDecimal.class, Constants.XSD_DECIMAL, new BigDecimalType());
    defaultRegister(tm, defaultNillable, BigInteger.class, Constants.XSD_INTEGER, new BigIntegerType());
    defaultRegister(tm, defaultNillable, Boolean.class, Constants.XSD_BOOLEAN, new BooleanType());
    defaultRegister(tm, defaultNillable, Calendar.class, Constants.XSD_DATETIME, new CalendarType());
    defaultRegister(tm, defaultNillable, Date.class, Constants.XSD_DATETIME, new DateTimeType());
    defaultRegister(tm, defaultNillable, Float.class, Constants.XSD_FLOAT, new FloatType());
    defaultRegister(tm, defaultNillable, Double.class, Constants.XSD_DOUBLE, new DoubleType());
    defaultRegister(tm, defaultNillable, Integer.class, Constants.XSD_INT, new IntType());
    defaultRegister(tm, defaultNillable, Long.class, Constants.XSD_LONG, new LongType());
    defaultRegister(tm, defaultNillable, Object.class, Constants.XSD_ANYTYPE, new ObjectType());
    defaultRegister(tm, defaultNillable, Byte.class, Constants.XSD_BYTE, new ByteType());
    defaultRegister(tm, defaultNillable, Short.class, Constants.XSD_SHORT, new ShortType());
    defaultRegister(tm, defaultNillable, Source.class, Constants.XSD_ANYTYPE, new SourceType());
    defaultRegister(tm, defaultNillable, String.class, Constants.XSD_STRING, new StringType());
    defaultRegister(tm, defaultNillable, Time.class, Constants.XSD_TIME, new TimeType());
    defaultRegister(tm, defaultNillable, Timestamp.class, Constants.XSD_DATETIME, new TimestampType());
    defaultRegister(tm, defaultNillable, URI.class, Constants.XSD_ANYURI, new URIType());
    defaultRegister(tm, defaultNillable, XMLStreamReader.class, Constants.XSD_ANYTYPE, new XMLStreamReaderType());
    defaultRegister(tm, defaultNillable, boolean.class, Constants.XSD_BOOLEAN, new BooleanType());
    defaultRegister(tm, defaultNillable, byte[].class, Constants.XSD_BASE64, new Base64Type());
    defaultRegister(tm, defaultNillable, double.class, Constants.XSD_DOUBLE, new DoubleType());
    defaultRegister(tm, defaultNillable, float.class, Constants.XSD_FLOAT, new FloatType());
    defaultRegister(tm, defaultNillable, int.class, Constants.XSD_INT, new IntType());
    defaultRegister(tm, defaultNillable, short.class, Constants.XSD_SHORT, new ShortType());
    defaultRegister(tm, defaultNillable, byte.class, Constants.XSD_BYTE, new ByteType());
    defaultRegister(tm, defaultNillable, long.class, Constants.XSD_LONG, new LongType());
    defaultRegister(tm, defaultNillable, java.sql.Date.class, Constants.XSD_DATETIME, new SqlDateType());
    defaultRegister(tm, defaultNillable, java.sql.Date.class, Constants.XSD_DATE, new SqlDateType());
    defaultRegister(tm, defaultNillable, Number.class, Constants.XSD_DECIMAL, new BigDecimalType());
    QName mtomBase64 = Constants.XSD_BASE64;
    if (enableMtomXmime) {
        mtomBase64 = AbstractXOPType.XML_MIME_BASE64;
    }
    defaultRegister(tm, defaultNillable, DataSource.class, mtomBase64, new DataSourceType(enableMtomXmime, null));
    defaultRegister(tm, defaultNillable, DataHandler.class, mtomBase64, new DataHandlerType(enableMtomXmime, null));
    defaultRegister(tm, defaultNillable, Document.class, Constants.XSD_ANYTYPE, new DocumentType());
    if (enableJDOM) {
        registerJDOMTypes(tm, defaultNillable);
    }
}
Also used : LongType(org.apache.cxf.aegis.type.basic.LongType) StringType(org.apache.cxf.aegis.type.basic.StringType) CharacterAsStringType(org.apache.cxf.aegis.type.basic.CharacterAsStringType) DataSourceType(org.apache.cxf.aegis.type.mtom.DataSourceType) SourceType(org.apache.cxf.aegis.type.xml.SourceType) ByteType(org.apache.cxf.aegis.type.basic.ByteType) Base64Type(org.apache.cxf.aegis.type.basic.Base64Type) FloatType(org.apache.cxf.aegis.type.basic.FloatType) IntType(org.apache.cxf.aegis.type.basic.IntType) TimeType(org.apache.cxf.aegis.type.basic.TimeType) DateTimeType(org.apache.cxf.aegis.type.basic.DateTimeType) ObjectType(org.apache.cxf.aegis.type.basic.ObjectType) DataHandlerType(org.apache.cxf.aegis.type.mtom.DataHandlerType) DataSourceType(org.apache.cxf.aegis.type.mtom.DataSourceType) TimestampType(org.apache.cxf.aegis.type.basic.TimestampType) XMLStreamReaderType(org.apache.cxf.aegis.type.xml.XMLStreamReaderType) QName(javax.xml.namespace.QName) ShortType(org.apache.cxf.aegis.type.basic.ShortType) BooleanType(org.apache.cxf.aegis.type.basic.BooleanType) DocumentType(org.apache.cxf.aegis.type.xml.DocumentType) JDOMDocumentType(org.apache.cxf.aegis.type.xml.JDOMDocumentType) URIType(org.apache.cxf.aegis.type.basic.URIType) DateTimeType(org.apache.cxf.aegis.type.basic.DateTimeType) SqlDateType(org.apache.cxf.aegis.type.basic.SqlDateType) BigIntegerType(org.apache.cxf.aegis.type.basic.BigIntegerType) DoubleType(org.apache.cxf.aegis.type.basic.DoubleType) BigDecimalType(org.apache.cxf.aegis.type.basic.BigDecimalType) CalendarType(org.apache.cxf.aegis.type.basic.CalendarType)

Example 2 with ShortType

use of org.apache.cxf.aegis.type.basic.ShortType in project cxf by apache.

the class DefaultTypeMapping method createSoap11TypeMapping.

/**
 * Create a type mapping object with a stock set of mappings, including the SOAP 1.1 'encoded'
 * types.
 * @param defaultNillable whether elements are nillable by default.
 * @param enableMtomXmime whether to enable XMIME annotations with MTOM.
 * @param enableJDOM whether to add mappings for JDOM.
 * @return
 */
public static DefaultTypeMapping createSoap11TypeMapping(boolean defaultNillable, boolean enableMtomXmime, boolean enableJDOM) {
    // Create a AegisType Mapping for SOAP 1.1 Encoding
    DefaultTypeMapping soapTM = new DefaultTypeMapping(Soap11.SOAP_ENCODING_URI);
    fillStandardMappings(soapTM, defaultNillable, enableMtomXmime, enableJDOM);
    defaultRegister(soapTM, defaultNillable, boolean.class, Soap11.ENCODED_BOOLEAN, new BooleanType());
    defaultRegister(soapTM, defaultNillable, char.class, Soap11.ENCODED_CHAR, new CharacterType());
    defaultRegister(soapTM, defaultNillable, int.class, Soap11.ENCODED_INT, new IntType());
    defaultRegister(soapTM, defaultNillable, short.class, Soap11.ENCODED_SHORT, new ShortType());
    defaultRegister(soapTM, defaultNillable, double.class, Soap11.ENCODED_DOUBLE, new DoubleType());
    defaultRegister(soapTM, defaultNillable, float.class, Soap11.ENCODED_FLOAT, new FloatType());
    defaultRegister(soapTM, defaultNillable, long.class, Soap11.ENCODED_LONG, new LongType());
    defaultRegister(soapTM, defaultNillable, char.class, Soap11.ENCODED_CHAR, new CharacterType());
    defaultRegister(soapTM, defaultNillable, Character.class, Soap11.ENCODED_CHAR, new CharacterType());
    defaultRegister(soapTM, defaultNillable, String.class, Soap11.ENCODED_STRING, new StringType());
    defaultRegister(soapTM, defaultNillable, Boolean.class, Soap11.ENCODED_BOOLEAN, new BooleanType());
    defaultRegister(soapTM, defaultNillable, Integer.class, Soap11.ENCODED_INT, new IntType());
    defaultRegister(soapTM, defaultNillable, Short.class, Soap11.ENCODED_SHORT, new ShortType());
    defaultRegister(soapTM, defaultNillable, Double.class, Soap11.ENCODED_DOUBLE, new DoubleType());
    defaultRegister(soapTM, defaultNillable, Float.class, Soap11.ENCODED_FLOAT, new FloatType());
    defaultRegister(soapTM, defaultNillable, Long.class, Soap11.ENCODED_LONG, new LongType());
    defaultRegister(soapTM, defaultNillable, Date.class, Soap11.ENCODED_DATETIME, new DateTimeType());
    defaultRegister(soapTM, defaultNillable, java.sql.Date.class, Soap11.ENCODED_DATETIME, new SqlDateType());
    defaultRegister(soapTM, defaultNillable, Calendar.class, Soap11.ENCODED_DATETIME, new CalendarType());
    defaultRegister(soapTM, defaultNillable, byte[].class, Soap11.ENCODED_BASE64, new Base64Type());
    defaultRegister(soapTM, defaultNillable, BigDecimal.class, Soap11.ENCODED_DECIMAL, new BigDecimalType());
    defaultRegister(soapTM, defaultNillable, BigInteger.class, Soap11.ENCODED_INTEGER, new BigIntegerType());
    return soapTM;
}
Also used : LongType(org.apache.cxf.aegis.type.basic.LongType) StringType(org.apache.cxf.aegis.type.basic.StringType) CharacterAsStringType(org.apache.cxf.aegis.type.basic.CharacterAsStringType) ShortType(org.apache.cxf.aegis.type.basic.ShortType) BooleanType(org.apache.cxf.aegis.type.basic.BooleanType) CharacterType(org.apache.cxf.aegis.type.basic.CharacterType) Base64Type(org.apache.cxf.aegis.type.basic.Base64Type) IntType(org.apache.cxf.aegis.type.basic.IntType) FloatType(org.apache.cxf.aegis.type.basic.FloatType) DateTimeType(org.apache.cxf.aegis.type.basic.DateTimeType) SqlDateType(org.apache.cxf.aegis.type.basic.SqlDateType) BigIntegerType(org.apache.cxf.aegis.type.basic.BigIntegerType) DoubleType(org.apache.cxf.aegis.type.basic.DoubleType) BigDecimalType(org.apache.cxf.aegis.type.basic.BigDecimalType) CalendarType(org.apache.cxf.aegis.type.basic.CalendarType)

Aggregations

Base64Type (org.apache.cxf.aegis.type.basic.Base64Type)2 BigDecimalType (org.apache.cxf.aegis.type.basic.BigDecimalType)2 BigIntegerType (org.apache.cxf.aegis.type.basic.BigIntegerType)2 BooleanType (org.apache.cxf.aegis.type.basic.BooleanType)2 CalendarType (org.apache.cxf.aegis.type.basic.CalendarType)2 CharacterAsStringType (org.apache.cxf.aegis.type.basic.CharacterAsStringType)2 DateTimeType (org.apache.cxf.aegis.type.basic.DateTimeType)2 DoubleType (org.apache.cxf.aegis.type.basic.DoubleType)2 FloatType (org.apache.cxf.aegis.type.basic.FloatType)2 IntType (org.apache.cxf.aegis.type.basic.IntType)2 LongType (org.apache.cxf.aegis.type.basic.LongType)2 ShortType (org.apache.cxf.aegis.type.basic.ShortType)2 SqlDateType (org.apache.cxf.aegis.type.basic.SqlDateType)2 StringType (org.apache.cxf.aegis.type.basic.StringType)2 QName (javax.xml.namespace.QName)1 ByteType (org.apache.cxf.aegis.type.basic.ByteType)1 CharacterType (org.apache.cxf.aegis.type.basic.CharacterType)1 ObjectType (org.apache.cxf.aegis.type.basic.ObjectType)1 TimeType (org.apache.cxf.aegis.type.basic.TimeType)1 TimestampType (org.apache.cxf.aegis.type.basic.TimestampType)1