[Index]

Derived PropertyTypes Overview


Derived API classes as type (18)

  PropertyType options  
Name Type Required Optional Value examples Examples & Links
«abstract»
AbstractKeyPropertyType
T
  • algorithm [final String]
  • derivedFromType [Property<File>]
  • encodedKeySpecClass [final Class<? extends EncodedKeySpec>]
  • typeName [String]
  • defaultValue [T] [null]
  [Examples]
[API Doc]
BytesFromFilePropertyType java.lang.byte[]
  • derivedFromFile [Property<File>]
    [Examples]
[API Doc]
CertificateKeyStoredPropertyType java.security.cert.Certificate
  • keystoreProperty [Property<KeyStore>]
  • alias [String] [Alias]
  • aliasProperty [Property<String>] [Alias StringProperty]
  [Examples]
[API Doc]
CertificateSignedFilePropertyType dk.heick.properties.types.custom.SignedFile
  • certificateProperty [Property<Certificate>]
  • signatureProperty [Property<byte[]>]
  • signedFileProperty [Property<File>]
    [Examples]
[API Doc]
CertificatesFilePropertyType java.util.Collection<? extends java.security.cert.Certificate>
  • certificatesFileProperty [Property<File>]
  • certificateType [final String] [X.509]
  • provider [String] [null]
  [Examples]
[API Doc]
«abstract»
DerivedFromSinglePropertyType
T
  • derivedFromType [Property<K>]
  • typeName [final String]
  • defaultValue [T] [null]
  [Examples]
[API Doc]
DerivedFromTypePropertyType T
  • derivedFromType [Property<K>]
  • fromType [TypeFromGeneric<K,T>]
  • defaultValue [T] [null]
  [Examples]
[API Doc]
«abstract»
DerivedPropertyType
T
  • typeName [final String]
  • defaultValue [T] [null]
  • derivedFrom [final Property<?>...] [null]
  • derivedFromCount [Integer] [-1]
  • derivedFromType [Property<?>] [null]
  • maxDerivedFrom [Integer] [-1]
  • minDerivedFrom [Integer] [-1]
  [Examples]
[API Doc]
FileDerivedPropertyType T
  • derivedFromFile [Property<File>]
  • fromFile [TypeFromGeneric<File,T>]
  • defaultValue [T] [null]
  [Examples]
[API Doc]
ImageFromFilePropertyType java.awt.image.BufferedImage
  • derivedFromFile [Property<File>]
  • defaultValue [BufferedImage] [null]
  [Examples]
[API Doc]
ImageFromURLPropertyType java.awt.image.BufferedImage
  • derivedFromUrl [Property<URL>]
  • defaultValue [BufferedImage] [null]
  [Examples]
[API Doc]
KeySignedFilePropertyType dk.heick.properties.types.custom.SignedFile
  • publicKeyProperty [Property<PublicKey>]
  • signatureFileProperty [Property<byte[]>]
  • signedFileProperty [Property<File>]
  • algorithm [String] [SHA1withDSA]
  • provider [String] [SUN]
  [Examples]
[API Doc]
KeyStoreFilePropertyType java.security.KeyStore
  • keyStoreFile [Property<File>]
  • keyStorePasswordProperty [Property<PasswordTypeVO>]
  • keyStoreType [String] [String or Property]
  • provider [String] [null]
  [Examples]
[API Doc]
PrivateKeyFilePropertyType java.security.PrivateKey
  • algorithm [final String]
  • derivedFromFile [Property<File>]
  • encodedKeySpecClass [final Class<? extends EncodedKeySpec>] [PKCS8EncodedKeySpec.class]
  [Examples]
[API Doc]
PublicKeyFilePropertyType java.security.PublicKey
  • algorithm [final String]
  • derivedFromFile [Property<File>]
  • encodedKeySpecClass [final Class<? extends EncodedKeySpec>] [X509EncodedKeySpec.class]
  [Examples]
[API Doc]
TextFromFilePropertyType java.lang.String
  • derivedFromFile [Property<File>]
  • defaultValue [String] [null]
  • encoding [final String] [Charset.defaultCharset()]
  [Examples]
[API Doc]
TypeListFromTextFilePropertyType java.util.List<T>
  • derivedFromFile [Property<File>]
  • propertyType [PropertyType<T>]
  • encoding [final String] [Charset.defaultCharset()]
  • ignoreLineRegex [final String] [null]
  [Examples]
[API Doc]
URLDerivedPropertyType T
  • derivedFromURL [Property<URL>]
  • fromURL [TypeFromGeneric<URL,T>]
  • defaultValue [T] [null]
  [Examples]
[API Doc]








EXAMPLES



Example : AbstractKeyPropertyType [to type] [to top]
Note: Abstract type see inherited implementations.
Example : BytesFromFilePropertyType [to type] [to top]
Property<File> FILE_PROPERTY = new Property<File>("app.my.byte.file",new FilePropertyType());
Property<byte[]> BYTE_PROPERTY new Property<byte[]>("app.my.byte.stream",new BytesFromFilePropertyType(FILE_PROPERTY));
Example : CertificateKeyStoredPropertyType [to type] [to top]
  Property<File> keyStoreFile = new Property<File>("keystore_file",new FilePropertyType());
  Property<PasswordTypeVO> password = new Property<PasswordTypeVO>("password",new PasswordPropertyType());
  Property<String> alias = new Property<String>("alias",new StringPropertyType());
  //
  Property<KeyStore> keystore = new Property<KeyStore>("keystore",new KeyStoreFilePropertyType(keyStoreFile,password));
  //
  Property<Certificate> certificate1 = new Property<Certificate>("certificate",new CertificateKeyStoredPropertyType(keystore,"ca"));
  Property<Certificate> certificate2 = new Property<Certificate>("certificate",new CertificateKeyStoredPropertyType(keystore,alias));			
Example : CertificateSignedFilePropertyType [to type] [to top]
  //Certificate
  Property<File> keyStoreFile = new Property<File>("keystore_file",new FilePropertyType());
  Property<PasswordTypeVO> password = new Property<PasswordTypeVO>("password",new PasswordPropertyType());
  Property<KeyStore> keystore = new Property<KeyStore>("keystore",new KeyStoreFilePropertyType(keyStoreFile,password));
  Property<Certificate> certificate1 = new Property<Certificate>("certificate",new CertificateKeyStoredPropertyType(keystore,"ca"));

  //Signature file
  Property<File> signatureFileProperty = new Property<File>("app.my.byte.file",new FilePropertyType());
  Property<byte[]> signature = new Property<byte[]>("app.my.byte.stream",new BytesFromFilePropertyType(signatureFileProperty));
  
  //Signed file
  Property<File> signedFileProperty = new Property<File>("signed.file",new FilePropertyType());

  //Final property
  Property<SignedFile> signedFileProperty = new Property<SignedFile>("certifcate.signed.file",new CertificateSignedFilePropertyType(signedFileProperty,certificate1,signature));		


Example : CertificatesFilePropertyType [to type] [to top]
  Property certificatesFileProperty = new Property("certificates.file",new FilePropertyType());
  
  Property<Collection<Certificate>> certificatesProperty = new Property<Collection<Certificate>>("certifcates",new CertificatesFilePropertyType(certificatesFileProperty));
  
Example : DerivedFromSinglePropertyType [to type] [to top]
Note: Abstract type see inherited implementations.
Example : DerivedFromTypePropertyType [to type] [to top]
public class BytesFromFile implements TypeFromGeneric<File,byte[]> {
	public final static String TYPE = "Byte array from File";
	
	private Log logger = LogFactory.getLog(getClass());

	public BytesFromFile() {
		super();
	}
	@Override
	public String getTypeName() {
		return TYPE;
	}
	@Override
	public List<String> getRestrictions() {
		StringList list = new StringList();
		list.add("A byte array loaded from a File.");		
		return list.asUnmodifiableList();
	}
	@Override
	public Log getLogger() {
		return logger;
	}
	@Override
	public void validateConstraints(String propertyName) throws PropertyException {
		//None		
	}
	@Override
	public byte[] fromType(String propertyName, File from) throws PropertyException {
		return FileUtils.loadAsBytes(propertyName,from);
	}

}

Property<File> FILE_PROPERTY = new Property<File>("file.property", new FilePropertyType(new File("c:\temp\test.htm"));
Property<byte[]> BYTE_FILE_PROPERTY = new Property<byte[]>("byte.file.property", new DerivedFromTypePropertyType(FILE_PROPERTY, new BytesFromFile()));
Example : DerivedPropertyType [to type] [to top]
Note: Abstract type see inherited implementations.
Example : FileDerivedPropertyType [to type] [to top]
Property<File> FILE_PROPERTY = new Property<File>("file.property", new FilePropertyType(new File("c:\temp\test.htm"));
Property<String> A_PROPERTY= new Property<StringT>("textfile.derived.property", new FileDerivedPropertyType(FILE_PROPERTY,new TextFromFile()));
Example : ImageFromFilePropertyType [to type] [to top]
Property<File> FILE_PROPERTY = new Property<File>("app.my.byte.file",new FilePropertyType());
Property<BufferedImage> IMAGE_PROPERTY new Property<BufferedImage>("app.my.image.stream",new ImageFromFilePropertyType(FILE_PROPERTY));			
Example : ImageFromURLPropertyType [to type] [to top]
Property<URL> URL_PROPERTY = new Property<File>("url.property", new URLPropertyType());
Property<BufferedImage> IMAGE_PROPERTY new Property<BufferedImage>("app.my.image.stream",new ImageFromURLPropertyType(URL_PROPERTY));
Example : KeySignedFilePropertyType [to type] [to top]
 Property<File> signedDataFile = new Property<File>("p.data.file",new FilePropertyType());
 Property<File> publicKeyFile = new Property<File>("p.publickey.file",new FilePropertyType());
 Property<File> signatuteFile = new Property<File>("p.signature.file",new FilePropertyType());
 //
 Property<PublicKey> publicKeyFromFile = new Property<PublicKey>("na.public.key.from.file",new PublicKeyFilePropertyType(publicKeyFile, "DSA"));
 Property<byte[]> signatureDataFile = new Property<byte[]>("na.p.signature.data",new BytesFromFilePropertyType(signatuteFile));
 //
 Property<SignedFile> signedFile = new Property<SignedFile>("signed.file",new KeySignedFilePropertyType(signedDataFile,publicKeyFromFile,signatureDataFile));
Example : KeyStoreFilePropertyType [to type] [to top]
Property<File> keyStoreFile = new Property<File>("keystore_file",new FilePropertyType());
Property<PasswordTypeVO> password = new Property<PasswordTypeVO>("password",new PasswordPropertyType());
Property<KeyStore> keystore= new Property<KeyStore>("keystore",new KeyStoreFilePropertyType(keyStoreFile,password));
Example : PrivateKeyFilePropertyType [to type] [to top]
Property<File> FILE_PROPERTY = new Property<File>("privatekey.file.property", new FilePropertyType(new File("c:\temp\myprivatekey.ppk"));
Property<PrivateKey> A_PROPERTY= new Property<PrivateKey>("name", new PrivateKeyFilePropertyType(FILE_PROPERTY,"DSA"));
Example : PublicKeyFilePropertyType [to type] [to top]
Property<File> FILE_PROPERTY = new Property<File>("publickey.file.property", new FilePropertyType(new File("c:\temp\mypublickey.pub"));
Property<PublicKey> A_PROPERTY= new Property<PublicKey>("name", new PublicKeyFilePropertyType(FILE_PROPERTY,"DSA"));
Example : TextFromFilePropertyType [to type] [to top]
Property<File> FILE_PROPERTY = new Property<File>("file.property", new FilePropertyType(new File("c:\temp\test.htm"));
Property<String> A_PROPERTY= new Property<String>("name", new TextFromFilePropertyType(FILE_PROPERTY));
Example : TypeListFromTextFilePropertyType [to type] [to top]
Property<File> FILE_PROPERTY = new Property<File>("file.property", new FilePropertyType());
Property<List<URL>> URL_LIST_PROPERTY = new Property<List<URL>>("url.list", new TypeListFromTextFilePropertyType<URL>(FILE_PROPERTY, new URLPropertyType());
Example : URLDerivedPropertyType [to type] [to top]
Property<T> A_PROPERTY= new Property<T>("name", new URLDerivedPropertyType());