1 22 23 package org.xquark.xquery.parser.primitivefunctions.fnfunctions; 24 25 import java.util.ArrayList ; 26 27 import org.xquark.xquery.parser.*; 28 import org.xquark.xquery.typing.TypeException; 29 30 31 38 public class FunctionDOC extends InputFunctionCall { 39 40 private static final String RCSRevision = "$Revision: 1.8 $"; 41 private static final String RCSName = "$Name: $"; 42 43 47 public void accept(ParserVisitor visitor) throws XQueryException { 48 visitor.visit(this); 49 } 50 51 55 public FunctionDOC(ArrayList args, XQueryModule parentModule) 56 throws TypeException, XQueryException { 57 super(new QName(null, null, "doc", null, null), args); 58 setParentModule(parentModule); 59 if (parentModule != null && parentModule.getStaticContext().getTypeVisitor() != null) 60 accept(parentModule.getStaticContext().getTypeVisitor()); 61 } 62 63 public void setArguments(ArrayList arguments) throws XQueryException { 64 if (arguments == null || arguments.size() != 1) throw new XQueryException("Function doc should have one argument"); 65 super.setArguments(arguments); 66 } 67 68 public String getDocumentName() { 69 return ((ValueString) arguments.get(0)).getValue(); 70 } 71 72 } 73 | Popular Tags |