protected boolean checkFormat( String lexicalValue, ValidationContext context ) { final int len = lexicalValue.length(); // "111" is not a valid hex encoding. if( len%2 != 0 ) return false; for( int i=0; i<len; i++ ) if( hexToBin(lexicalValue.charAt(i))==-1 ) return false; return true; }
public String serializeJavaObject( Object value, SerializationContext context ) { if(!(value instanceof byte[])) throw new IllegalArgumentException(); return save( (byte[])value ); }
public String convertToLexicalValue( Object value, SerializationContext context ) { if(!(value instanceof BinaryValueType)) throw new IllegalArgumentException(); return serializeJavaObject( ((BinaryValueType)value).rawData, context ); }
public Object _createValue( String lexicalValue, ValidationContext context ) { byte[] buf = load(lexicalValue); if(buf==null) return null; else return new BinaryValueType(buf); }
assertTrue( SimpleURType.theInstance==BooleanType.theInstance.getBaseType() ); assertTrue( SimpleURType.theInstance==Base64BinaryType.theInstance.getBaseType() ); assertTrue( SimpleURType.theInstance==HexBinaryType.theInstance.getBaseType() ); assertTrue( SimpleURType.theInstance==FloatType.theInstance.getBaseType() ); assertTrue( SimpleURType.theInstance==DoubleType.theInstance.getBaseType() );
public String convertToLexicalValue( Object value, SerializationContext context ) { if(!(value instanceof BinaryValueType)) throw new IllegalArgumentException(); return serializeJavaObject( ((BinaryValueType)value).rawData, context ); }
public Object _createValue( String lexicalValue, ValidationContext context ) { byte[] buf = load(lexicalValue); if(buf==null) return null; else return new BinaryValueType(buf); }
protected boolean checkFormat( String lexicalValue, ValidationContext context ) { final int len = lexicalValue.length(); // "111" is not a valid hex encoding. if( len%2 != 0 ) return false; for( int i=0; i<len; i++ ) if( hexToBin(lexicalValue.charAt(i))==-1 ) return false; return true; }
public String convertToLexicalValue( Object value, SerializationContext context ) { if(!(value instanceof BinaryValueType)) throw new IllegalArgumentException(); return serializeJavaObject( ((BinaryValueType)value).rawData, context ); }
public String serializeJavaObject( Object value, SerializationContext context ) { if(!(value instanceof byte[])) throw new IllegalArgumentException(); return save( (byte[])value ); }
public Object _createValue( String lexicalValue, ValidationContext context ) { byte[] buf = load(lexicalValue); if(buf==null) return null; else return new BinaryValueType(buf); }
protected boolean checkFormat( String lexicalValue, ValidationContext context ) { final int len = lexicalValue.length(); // "111" is not a valid hex encoding. if( len%2 != 0 ) return false; for( int i=0; i<len; i++ ) if( hexToBin(lexicalValue.charAt(i))==-1 ) return false; return true; }
public String convertToLexicalValue( Object value, SerializationContext context ) { if(!(value instanceof BinaryValueType)) throw new IllegalArgumentException(); return serializeJavaObject( ((BinaryValueType)value).rawData, context ); }
public String serializeJavaObject( Object value, SerializationContext context ) { if(!(value instanceof byte[])) throw new IllegalArgumentException(); return save( (byte[])value ); }
public Object _createValue( String lexicalValue, ValidationContext context ) { byte[] buf = load(lexicalValue); if(buf==null) return null; else return new BinaryValueType(buf); }
protected boolean checkFormat( String lexicalValue, ValidationContext context ) { final int len = lexicalValue.length(); // "111" is not a valid hex encoding. if( len%2 != 0 ) return false; for( int i=0; i<len; i++ ) if( hexToBin(lexicalValue.charAt(i))==-1 ) return false; return true; }
public String convertToLexicalValue( Object value, SerializationContext context ) { if(!(value instanceof BinaryValueType)) throw new IllegalArgumentException(); return serializeJavaObject( ((BinaryValueType)value).rawData, context ); }