01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.rewriter.rom.js;
06:
07: import com.sun.portal.rewriter.rom.Rule;
08: import com.sun.portal.rewriter.util.Constants;
09: import com.sun.portal.rewriter.util.StringHelper;
10:
11: public final class Function extends JSData {
12: private String paramPatterns;
13:
14: public Function(final String aName, final String aParamPatterns) {
15: this (aName, aParamPatterns, Rule.EXPRESSION, null);
16: }//constructor
17:
18: public Function(final String aName, final String aParamPatterns,
19: final String aType, final String aSource) {
20: super (Rule.FUNCTION, aName, aType, aSource);
21: paramPatterns = StringHelper.normalize(aParamPatterns);
22: }//constructor
23:
24: public String getArgumentPatterns() {
25: return paramPatterns;
26: }//getValuePatterns()
27:
28: public Function recycleMatchee(final String aName,
29: final int aParamCount) {
30: setName(aName);
31: return this ;
32: }//recycleMatchee()
33:
34: public final void writeCustomAttributes(final StringBuffer aBuffer) {
35: super .writeCustomAttributes(aBuffer);
36: aBuffer.append(Constants.SINGLE_SPACE).append(
37: Rule.PARAM_PATTERNS).append(Constants.EQUALS).append(
38: Constants.DOUBLE_QUOTES).append(getArgumentPatterns())
39: .append(Constants.DOUBLE_QUOTES);
40: }//toXML()
41:
42: }//class Function
|