EASP API 7.15.0

net.juniper.smgt.lib.subst
Class SubstEngineFactory

java.lang.Object
  extended by net.juniper.smgt.lib.subst.SubstEngineFactory

public class SubstEngineFactory
extends java.lang.Object

This class contains the factory method for generating SubstitutionEngines and several other substitution oriented utility methods.

One category of utility methods deal with manipulating substitution varible types in the form of strings and in the form of integers from the variable type enumeration in Substitution. Included in this category are:

Another category of of utility methods deal with encoding and decoding strings so that they can be used in the string representation of substitutions that are to be parsed and validated by SubstEngine.createSubstitution(String) and related methods. The utility methods in this category are:


Constructor Summary
SubstEngineFactory()
           
 
Method Summary
static SubstEngine anInstance()
          Returns an instance of a SubstEngine.
static java.lang.String decodeIdentifier(java.lang.String encoded)
          returns a decoded version of the given string representing a parsable identifier.
static java.lang.String encodeIdentifier(java.lang.String decoded)
          encodes the given identifier so it may be parsed.
static void main(java.lang.String[] args)
          converts substitutions from SDX 4.3 or older format to post SDX 4.3 format to new format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubstEngineFactory

public SubstEngineFactory()
Method Detail

anInstance

public static SubstEngine anInstance()
Returns an instance of a SubstEngine. The system creates a pool of SubstEngines. Some operations, such as SubstEngine.acquireParams(List,List), SubstEngine.classify(List,List,List,List), and SubstEngine.createSubstitution(String), may block a thread for a significant amount of time. Consequently, this method returns a random instance of SubstEngine from the pool so several threads can proceed with complex substitution operations in parallel.

Returns:
net.juniper.smgt.lib.subst.SubstEngine a random instance from the pool

decodeIdentifier

public static java.lang.String decodeIdentifier(java.lang.String encoded)
                                         throws java.lang.IllegalArgumentException
returns a decoded version of the given string representing a parsable identifier. Replaces all substrings of the form $xxxx where the x's are hex digits with the unicode character represented by the xxx

Parameters:
encoded -
Returns:
Throws:
java.lang.IllegalArgumentException - if the input string is null or empty, or if the input contains a '$' character which is not followed by four hex digits

encodeIdentifier

public static java.lang.String encodeIdentifier(java.lang.String decoded)
encodes the given identifier so it may be parsed. replaces all characters that are not alpha numeric with $xxxx where xxxx is the hex encoding of the unicode for the character. If the first character is a digit, it will also be encoded.

Parameters:
decoded -
Returns:
Throws:
java.lang.IllegalArgumentException - if the input string is null or empty

main

public static void main(java.lang.String[] args)
converts substitutions from SDX 4.3 or older format to post SDX 4.3 format to new format. If there are command line arguments, parses each as old format substitution and writes equivalent new format substitutions one per line on standard output. Otherwise reads old format substitutions one per line from standard input and writes equivalent new format substitution one per line on standard output.

Parameters:
args -

EASP API 7.15.0