/** * Set the class name for the generated translet. This class name is * overridden if multiple stylesheets are compiled in one go using the * compile(Vector urls) method. * @param className The name to assign to the translet class */ public void setClassName(String className) { final String base = Util.baseName(className); final String noext = Util.noExtName(base); String name = Util.toJavaName(noext); if (_packageName == null) _className = name; else _className = _packageName + '.' + name; }
/** * Set the name of the variable or paremeter. Escape all special chars. */ public void setName(QName name) { _name = name; _escapedName = Util.escape(name.getStringRep()); }
public org.apache.bcel.generic.Type toJCType() { return Util.getJCRefType(toSignature()); }
final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = new InstructionList(); String methodName = Util.escape(template.getName().toString()); new org.apache.bcel.generic.Type[4 + numParams]; String[] names = new String[4 + numParams]; types[0] = Util.getJCRefType(DOM_INTF_SIG); types[1] = Util.getJCRefType(NODE_ITERATOR_SIG); types[2] = Util.getJCRefType(TRANSLET_OUTPUT_SIG); types[3] = org.apache.bcel.generic.Type.INT; names[0] = DOCUMENT_PNAME; types[i] = Util.getJCRefType(OBJECT_SIG); names[i] = "param" + String.valueOf(i-4);
_isLiteralName = Util.isLiteral(name); if (_isLiteralName) { if (!XML11Char.isXML11ValidQName(name)) { if (Util.isLiteral(namespace)) { prefix = lookupPrefix(namespace); if (prefix == null) { if (!Util.isValidQNames(useSets)) { ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, useSets, this); parser.reportError(Constants.ERROR, err);
/** * Displays the contents of this element (for debugging) */ public void display(int indent) { indent(indent); Util.println("Output " + _method); }
public void parseContents(Parser parser) { final String useSets = getAttribute("use-attribute-sets"); if (useSets.length() > 0) { if (!Util.isValidQNames(useSets)) { ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, useSets, this); parser.reportError(Constants.ERROR, err); } _useSets = new UseAttributeSets(useSets, parser); } parseChildren(parser); }
/** * Replace occurances of '.', '-', '/' and ':' */ public static String escape(String input) { return replace(input, ".-/:", new String[] { "$dot$", "$dash$", "$slash$", "$colon$" }); }
public static String baseName(String name) { return org.apache.xalan.xsltc.compiler.util.Util.baseName(name); }
public void parseContents(Parser parser) { final String name = getAttribute("name"); if (name.length() > 0) { _isLiteral = Util.isLiteral(name); if (_isLiteral) { if (!XML11Char.isXML11ValidNCName(name)) { ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_NCNAME_ERR, name, this); parser.reportError(Constants.ERROR, err); } } _name = AttributeValue.create(this, name, parser); } else reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "name"); if (name.equals("xml")) { reportError(this, parser, ErrorMsg.ILLEGAL_PI_ERR, "xml"); } parseChildren(parser); }
public static String noExtName(String name) { return org.apache.xalan.xsltc.compiler.util.Util.noExtName(name); }
public static String toJavaName(String name) { return org.apache.xalan.xsltc.compiler.util.Util.toJavaName(name); }
/** * Reports on whether the function specified in the argument to * xslt function 'function-available' was found. */ public boolean getResult() { if (_nameOfFunct == null) { return false; } if (isInternalNamespace()) { final Parser parser = getParser(); _isFunctionAvailable = parser.functionSupported(Util.getLocalName(_nameOfFunct)); } return _isFunctionAvailable; }
_isLiteralName = Util.isLiteral(name); if (_isLiteralName) { if (!XML11Char.isXML11ValidQName(name)) { if (Util.isLiteral(namespace)) { prefix = lookupPrefix(namespace); if (prefix == null) { if (!Util.isValidQNames(useSets)) { ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, useSets, this); parser.reportError(Constants.ERROR, err);
if (!Util.isValidQNames(useSets)) { ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, useSets, this); parser.reportError(Constants.ERROR, err);
/** * Replace a certain character in a string with a new substring. */ public static String replace(String base, char ch, String str) { return (base.indexOf(ch) < 0) ? base : replace(base, String.valueOf(ch), new String[] { str }); }
setClassName(Util.baseName(systemId));
_isLiteral = Util.isLiteral(name); if (_isLiteral) { if (!XML11Char.isXML11ValidQName(name)) {
final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = new InstructionList(); String methodName = Util.escape(template.getName().toString()); new org.apache.bcel.generic.Type[4 + numParams]; String[] names = new String[4 + numParams]; types[0] = Util.getJCRefType(DOM_INTF_SIG); types[1] = Util.getJCRefType(NODE_ITERATOR_SIG); types[2] = Util.getJCRefType(TRANSLET_OUTPUT_SIG); types[3] = org.apache.bcel.generic.Type.INT; names[0] = DOCUMENT_PNAME; types[i] = Util.getJCRefType(OBJECT_SIG); names[i] = "param" + String.valueOf(i-4);