Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.6.0)

E13403-07

oracle.ide.externaltools.macro
Class ParameterizedMacro

java.lang.Object
  extended by oracle.ide.externaltools.macro.MacroExpander
      extended by oracle.ide.externaltools.macro.ParameterizedMacro
All Implemented Interfaces:
Displayable

public abstract class ParameterizedMacro
extends MacroExpander

A parameterized macro takes one or more parameters that can be used at expansion time.

The general syntax of a parameterized macro is:

 ${macroname:param1=value;param2=value;...}
 

Each supported parameter is represented by an instance of Parameter. Implementations of this class should return a collection of supported parameters in the getSupportedParameters() method.

An implementation of ParameterizedMacro has access to the values of all parameters in the MacroExpander.expand(Context) method via the protected getValue( Parameter ) method.

Since:
10.1.3

Constructor Summary
ParameterizedMacro()
           
 
Method Summary
 Parameter findParameter(java.lang.String name)
          Find a parameter from its name.
abstract  java.util.Collection<Parameter> getSupportedParameters()
          Gets the parameters supported by this macro.
protected  java.lang.String getValue(Parameter parameter)
          Gets the value of a parameter.
 void setValue(Parameter parameter, java.lang.String value)
          Sets the value of a parameter.
 java.lang.String toMacroString()
          Gets the text of this macro exactly as it appears in an unexpanded string.
 
Methods inherited from class oracle.ide.externaltools.macro.MacroExpander
expand, getIcon, getMacro, getSampleExpansion, getToolTipText, isAvailableForType, isDirectoryMacro, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.ide.model.Displayable
getLongLabel, getShortLabel
 

Constructor Detail

ParameterizedMacro

public ParameterizedMacro()
Method Detail

setValue

public final void setValue(Parameter parameter,
                           java.lang.String value)
Sets the value of a parameter.

Parameters:
parameter - one of the parameters supported by this macro.
value - the value of the specified parameter.

getValue

protected final java.lang.String getValue(Parameter parameter)
Gets the value of a parameter.

Parameters:
parameter - the parameter.
Returns:
the value of this parameter.

toMacroString

public java.lang.String toMacroString()
Gets the text of this macro exactly as it appears in an unexpanded string. This includes macro escape characters ( ${}).

This implementation returns a full string, including all parameter values.

Overrides:
toMacroString in class MacroExpander
Returns:
the text of this macro exactly as it appears in an unexpanded string.

findParameter

public Parameter findParameter(java.lang.String name)
Find a parameter from its name.

This implementation iterates each Parameter in getSupportedParameters() until it finds a matching parameter. Subclasses may wish to override this for performance reasons.

Parameters:
name - the name of a parameter.
Returns:
a supported parameter with the specified name, or null if the parameter is not recognized.

getSupportedParameters

public abstract java.util.Collection<Parameter> getSupportedParameters()
Gets the parameters supported by this macro.

Returns:
a collection of Parameter instances.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.6.0)

E13403-07

Copyright © 1997, 2011, Oracle. All rights reserved.