pmp.macro.str
Class UUID

java.lang.Object
  extended by pmp.AbstractMacro
      extended by pmp.macro.str.UUID

public class UUID
extends AbstractMacro

Generates random UUID/GUID. For generating random numbers is used SecureRandom with algorithm "SHA1PRNG". If not available, then standard Random class is used.

Title: PMP: Macroprocessor

Description: Java macroprocessor

Copyright: Copyright (c) 2005

Version:
1.0
Author:
Luděk Hlaváček
See Also:
UUID

Field Summary
static java.lang.String COMPACT
          Returns new UUID without hyphens.
static int PARAMS_REQUIRED
           
static java.lang.String REGISTRY
          Returns new UUID in Windows registry format (ie: surrounded with curly brackets).
static java.lang.String UUID_SCHEME
          Returns new UUID with "uuid:" prefix
 
Constructor Summary
UUID()
           
 
Method Summary
static java.lang.String generate(java.lang.String format)
          Generates new UUID.
 java.lang.String run(Macroprocessor mp, java.lang.String[] params)
          Main method of macro.
 
Methods inherited from class pmp.AbstractMacro
getRequiredParams, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PARAMS_REQUIRED

public static final int PARAMS_REQUIRED
See Also:
Constant Field Values

COMPACT

public static final java.lang.String COMPACT
Returns new UUID without hyphens.

See Also:
Constant Field Values

REGISTRY

public static final java.lang.String REGISTRY
Returns new UUID in Windows registry format (ie: surrounded with curly brackets).

See Also:
Constant Field Values

UUID_SCHEME

public static final java.lang.String UUID_SCHEME
Returns new UUID with "uuid:" prefix

See Also:
Constant Field Values
Constructor Detail

UUID

public UUID()
Method Detail

generate

public static java.lang.String generate(java.lang.String format)
Generates new UUID. This method creates new instance of this class and calls run(Macroprocessor,String[]) method.

Parameters:
format - format of generated uuid
Returns:
generated UUID

run

public java.lang.String run(Macroprocessor mp,
                            java.lang.String[] params)
Description copied from class: AbstractMacro
Main method of macro. This method is called when this macro is invoked. All subclasses must imlement this method

Specified by:
run in class AbstractMacro
Parameters:
mp - reference to Macroprocessor
params - parameters of macro. In args[0] is stored name of macro. Subclasses are free to modify this array.
Returns:
result of the macro as String