org.tranche.license
Class License

java.lang.Object
  extended by org.tranche.license.License

public class License
extends java.lang.Object

Class describing the licensing terms with title, short, and full-text descriptions.

Author:
James "Augie" Hill - augman85@gmail.com, Bryan E. Smith - bryanesmith@gmail.com

Field Summary
static License CC0
          STATIC GLOBAL VARIABLES
 
Constructor Summary
License(java.io.InputStream in)
           
License(java.lang.String title, java.lang.String shortDescription, java.lang.String description, boolean descriptionIsFile)
          Create a license with a title, short description, its encryption status, the URL of the license, and the full-text of the license.
 
Method Summary
 void deserialize(java.io.InputStream in)
           
 java.lang.String getDescription()
          The legal text or other text to describe the license.
 java.lang.String getShortDescription()
          Retrieve short description of the license.
 java.lang.String getTitle()
          Retrieve title of license.
 void serialize(java.io.OutputStream out)
           
 void setDescription(java.lang.String description)
          Set the license text.
 void setShortDescription(java.lang.String shortDescription)
          Set short description of the license.
 void setTitle(java.lang.String title)
          Set title of the license.
 java.lang.String toString()
          Return the title and encryption status appended.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CC0

public static License CC0
STATIC GLOBAL VARIABLES

Constructor Detail

License

public License(java.lang.String title,
               java.lang.String shortDescription,
               java.lang.String description,
               boolean descriptionIsFile)
Create a license with a title, short description, its encryption status, the URL of the license, and the full-text of the license.

Parameters:
title -
shortDescription - A brief description of the license
description - The full-text description of the license
descriptionIsFile - Whether the description is the local file containing the description.

License

public License(java.io.InputStream in)
        throws java.lang.Exception
Parameters:
in -
Throws:
java.lang.Exception
Method Detail

toString

public java.lang.String toString()
Return the title and encryption status appended.

Overrides:
toString in class java.lang.Object
Returns:

getShortDescription

public java.lang.String getShortDescription()
Retrieve short description of the license.

Returns:

setShortDescription

public void setShortDescription(java.lang.String shortDescription)
Set short description of the license.

Parameters:
shortDescription -

getTitle

public java.lang.String getTitle()
Retrieve title of license.

Returns:

setTitle

public void setTitle(java.lang.String title)
Set title of the license.

Parameters:
title -

getDescription

public java.lang.String getDescription()

The legal text or other text to describe the license.

Note this might be stored in memory or on disk. Returns null if not set.

Returns:
The legal text, if set, or null otherwise

setDescription

public void setDescription(java.lang.String description)
Set the license text. If set this way, any existing legal text will be ignored in favor of this text.

Parameters:
description -

serialize

public void serialize(java.io.OutputStream out)
               throws java.lang.Exception
Parameters:
out -
Throws:
java.lang.Exception

deserialize

public void deserialize(java.io.InputStream in)
                 throws java.lang.Exception
Parameters:
in -
Throws:
java.lang.Exception


This code is free for use both commercially and non-commercially as stated in the project's license