Package com.cedarsoft.version

Examples of com.cedarsoft.version.Version


/**
*
*/
public class DateTimeSerializer extends AbstractStaxMateSerializer<DateTime> {
  public DateTimeSerializer() {
    super( "dateTime", "http://www.joda.org/time/dateTime", new VersionRange( new Version( 0, 9, 0 ), new Version( 1, 0, 0 ) ) );
  }
View Full Code Here


  @Nonnull

  public static final String SEPARATOR = "x";

  public DimensionSerializer() {
    super( "dimension", "http://java.sun.com/awt/dimension", new VersionRange( new Version( 1, 0, 0 ), new Version( 1, 0, 0 ) ) );
  }
View Full Code Here

  @Nonnull

  private static final String ELEMENT_NAME = "name";

  public LicenseSerializer() {
    super( "license", "http://www.cedarsoft.com/serialization/license", License.class, new VersionRange( new Version( 1, 0, 0 ), new Version( 1, 0, 0 ) ) );
  }
View Full Code Here

/**
*
*/
public class VersionSerializer extends AbstractStaxMateSerializer<Version> {
  public VersionSerializer() {
    super( "version", "http://www.cedarsoft.com/version", new VersionRange( new Version( 1, 0, 0 ), new Version( 1, 0, 0 ) ) );
  }
View Full Code Here

  @Nonnull

  private static final String ATTRIBUTE_ALGORITHM = "algorithm";

  public HashSerializer() {
    super( "hash", "http://www.cedarsoft.com/crypt/hash", new VersionRange( new Version( 1, 0, 0 ), new Version( 1, 0, 0 ) ) );
  }
View Full Code Here

  public static final String ELEMENT_CONTENT_TYPE = "contentType";

  @Inject
  public FileTypeSerializer( @Nonnull ExtensionSerializer extensionSerializer ) {
    super( "fileType", "http://www.cedarsoft.com/file/type", new VersionRange( new Version( 1, 0, 0 ), new Version( 1, 0, 1 ) ) );

    add( extensionSerializer ).responsibleFor( Extension.class )
      .map( 1, 0, 0 ).to( 1, 0, 1 ).toDelegateVersion( 1, 0, 0 )
    ;
View Full Code Here

  public Application deserialize( @Nonnull XMLStreamReader deserializeFrom, @Nonnull Version formatVersion ) throws IOException, XMLStreamException {
    assert isVersionReadable( formatVersion );
    String name = getChildText( deserializeFrom, ELEMENT_NAME );

    nextTag( deserializeFrom, ELEMENT_VERSION );
    Version applicationVersion = deserialize( Version.class, formatVersion, deserializeFrom );
    closeTag( deserializeFrom );

    return new Application( name, applicationVersion );
  }
View Full Code Here

  @Override
  public void serialize( @Nonnull JsonGenerator serializeTo, @Nonnull T object, @Nonnull Version formatVersion ) throws IOException, VersionException, JsonProcessingException {
    assert isVersionWritable( formatVersion );

    SerializingStrategy<T, JsonGenerator, JsonParser, JsonProcessingException, OutputStream, InputStream> strategy = serializingStrategySupport.findStrategy( object );
    Version resolvedVersion = serializingStrategySupport.resolveVersion( strategy, formatVersion );
    serializeTo.writeStringField( PROPERTY_SUB_TYPE, strategy.getId() );

    strategy.serialize( serializeTo, object, resolvedVersion );
  }
View Full Code Here

    if ( type == null ) {
      throw new JsonParseException( "Attribute" + PROPERTY_SUB_TYPE + " not found. Cannot find strategy.", deserializeFrom.getCurrentLocation() );
    }

    SerializingStrategy<? extends T, JsonGenerator, JsonParser, JsonProcessingException, OutputStream, InputStream> strategy = serializingStrategySupport.findStrategy( type );
    Version resolvedVersion = serializingStrategySupport.resolveVersion( strategy, formatVersion );
    return strategy.deserialize( deserializeFrom, resolvedVersion );
  }
View Full Code Here

   */
  @Nonnull
  protected T deserializeInternal( @Nonnull JsonParser parser, @Nullable Version formatVersionOverride ) throws IOException, JsonProcessingException, InvalidTypeException {
    JacksonParserWrapper parserWrapper = new JacksonParserWrapper( parser );

    Version version = prepareDeserialization( parserWrapper, formatVersionOverride );

    T deserialized = deserialize( parser, version );

    if ( isObjectType() ) {
      if ( parserWrapper.getCurrentToken() != JsonToken.END_OBJECT ) {
View Full Code Here

TOP

Related Classes of com.cedarsoft.version.Version

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.