You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vxquery.apache.org by vi...@apache.org on 2009/12/16 01:20:48 UTC
svn commit: r891081 [2/2] - in /incubator/vxquery/trunk/vxquery/src:
main/java/org/apache/vxquery/api/ main/java/org/apache/vxquery/compiler/
main/java/org/apache/vxquery/datamodel/
main/java/org/apache/vxquery/datamodel/atomic/ main/java/org/apache/vx...
Modified: incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/CommentType.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/CommentType.java?rev=891081&r1=891080&r2=891081&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/CommentType.java (original)
+++ incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/CommentType.java Wed Dec 16 00:20:47 2009
@@ -1,23 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.vxquery.types;
import org.apache.vxquery.datamodel.DMOKind;
-import org.apache.vxquery.datamodel.NameCache;
import org.apache.vxquery.datamodel.XDMValue;
import org.apache.vxquery.exceptions.SystemException;
import org.apache.vxquery.util.Filter;
@@ -44,7 +43,7 @@
}
@Override
- public Filter<XDMValue> createInstanceOfFilter(NameCache nameCache) {
+ public Filter<XDMValue> createInstanceOfFilter() {
return INSTANCE_OF_FILTER;
}
}
\ No newline at end of file
Modified: incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/ComposedType.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/ComposedType.java?rev=891081&r1=891080&r2=891081&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/ComposedType.java (original)
+++ incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/ComposedType.java Wed Dec 16 00:20:47 2009
@@ -1,24 +1,23 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.vxquery.types;
import java.util.List;
-import org.apache.vxquery.datamodel.NameCache;
import org.apache.vxquery.datamodel.XDMValue;
import org.apache.vxquery.types.processors.CastProcessor;
import org.apache.vxquery.util.Filter;
@@ -41,7 +40,7 @@
}
@Override
- public Filter<XDMValue> createInstanceOfFilter(NameCache nameCache) {
+ public Filter<XDMValue> createInstanceOfFilter() {
return null;
}
Modified: incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/DocumentType.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/DocumentType.java?rev=891081&r1=891080&r2=891081&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/DocumentType.java (original)
+++ incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/DocumentType.java Wed Dec 16 00:20:47 2009
@@ -1,22 +1,21 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.vxquery.types;
-import org.apache.vxquery.datamodel.NameCache;
import org.apache.vxquery.datamodel.XDMValue;
import org.apache.vxquery.util.Filter;
@@ -39,7 +38,7 @@
}
@Override
- public Filter<XDMValue> createInstanceOfFilter(NameCache nameCache) {
+ public Filter<XDMValue> createInstanceOfFilter() {
return null;
}
}
\ No newline at end of file
Modified: incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/ElementType.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/ElementType.java?rev=891081&r1=891080&r2=891081&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/ElementType.java (original)
+++ incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/ElementType.java Wed Dec 16 00:20:47 2009
@@ -1,23 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.vxquery.types;
import org.apache.vxquery.datamodel.DMOKind;
-import org.apache.vxquery.datamodel.NameCache;
import org.apache.vxquery.datamodel.XDMNode;
import org.apache.vxquery.datamodel.XDMValue;
import org.apache.vxquery.exceptions.SystemException;
@@ -54,8 +53,8 @@
}
@Override
- public Filter<XDMValue> createInstanceOfFilter(NameCache nameCache) {
- final Filter<XDMNode> nameTestMatchFilter = nameTest.createNameMatchFilter(nameCache);
+ public Filter<XDMValue> createInstanceOfFilter() {
+ final Filter<XDMNode> nameTestMatchFilter = nameTest.createNameMatchFilter();
return new Filter<XDMValue>() {
@Override
public boolean accept(XDMValue value) throws SystemException {
Modified: incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/EmptySequenceType.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/EmptySequenceType.java?rev=891081&r1=891080&r2=891081&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/EmptySequenceType.java (original)
+++ incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/EmptySequenceType.java Wed Dec 16 00:20:47 2009
@@ -1,22 +1,21 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.vxquery.types;
-import org.apache.vxquery.datamodel.NameCache;
import org.apache.vxquery.datamodel.XDMValue;
import org.apache.vxquery.exceptions.SystemException;
import org.apache.vxquery.types.processors.CastProcessor;
@@ -42,7 +41,7 @@
}
@Override
- public Filter<XDMValue> createInstanceOfFilter(NameCache nameCache) {
+ public Filter<XDMValue> createInstanceOfFilter() {
return INSTANCE_OF_FILTER;
}
Modified: incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/NameTest.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/NameTest.java?rev=891081&r1=891080&r2=891081&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/NameTest.java (original)
+++ incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/NameTest.java Wed Dec 16 00:20:47 2009
@@ -1,25 +1,25 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.vxquery.types;
import javax.xml.namespace.QName;
-import org.apache.vxquery.datamodel.NameCache;
import org.apache.vxquery.datamodel.XDMNode;
+import org.apache.vxquery.datamodel.atomic.QNameValue;
import org.apache.vxquery.exceptions.SystemException;
import org.apache.vxquery.util.Filter;
@@ -52,7 +52,7 @@
}
@SuppressWarnings("unchecked")
- public Filter<XDMNode> createNameMatchFilter(final NameCache nameCache) {
+ public Filter<XDMNode> createNameMatchFilter() {
if (uri == null) {
if (localName == null) {
return (Filter<XDMNode>) Filter.TRUE_FILTER;
@@ -60,7 +60,7 @@
return new Filter<XDMNode>() {
@Override
public boolean accept(XDMNode value) throws SystemException {
- return nameCache.getLocalName(value.getNodeNameCode()).equals(localName);
+ return value.getNodeName().getLocalName().equals(localName);
}
};
}
@@ -69,15 +69,15 @@
return new Filter<XDMNode>() {
@Override
public boolean accept(XDMNode value) throws SystemException {
- return nameCache.probeUriCode(uri) == nameCache.getUriCode(value.getNodeNameCode());
+ return uri.equals(value.getNodeName().getUri());
}
};
} else {
- final int uriCode = NameCache.removePrefix(nameCache.intern("", uri, localName));
return new Filter<XDMNode>() {
@Override
public boolean accept(XDMNode value) throws SystemException {
- return NameCache.removePrefix(value.getNodeNameCode()) == uriCode;
+ QNameValue nodeName = value.getNodeName();
+ return uri.equals(nodeName.getUri()) && nodeName.getLocalName().equals(localName);
}
};
}
Modified: incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/NoneType.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/NoneType.java?rev=891081&r1=891080&r2=891081&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/NoneType.java (original)
+++ incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/NoneType.java Wed Dec 16 00:20:47 2009
@@ -1,22 +1,21 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.vxquery.types;
-import org.apache.vxquery.datamodel.NameCache;
import org.apache.vxquery.datamodel.XDMValue;
import org.apache.vxquery.types.processors.CastProcessor;
import org.apache.vxquery.types.processors.NotCastableCastProcessor;
@@ -35,7 +34,7 @@
@SuppressWarnings("unchecked")
@Override
- public Filter<XDMValue> createInstanceOfFilter(NameCache nameCache) {
+ public Filter<XDMValue> createInstanceOfFilter() {
return (Filter<XDMValue>) Filter.FALSE_FILTER;
}
Modified: incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/ProcessingInstructionType.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/ProcessingInstructionType.java?rev=891081&r1=891080&r2=891081&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/ProcessingInstructionType.java (original)
+++ incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/ProcessingInstructionType.java Wed Dec 16 00:20:47 2009
@@ -1,23 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.vxquery.types;
import org.apache.vxquery.datamodel.DMOKind;
-import org.apache.vxquery.datamodel.NameCache;
import org.apache.vxquery.datamodel.XDMNode;
import org.apache.vxquery.datamodel.XDMValue;
import org.apache.vxquery.exceptions.SystemException;
@@ -42,7 +41,7 @@
}
@Override
- public Filter<XDMValue> createInstanceOfFilter(final NameCache nameCache) {
+ public Filter<XDMValue> createInstanceOfFilter() {
return new Filter<XDMValue>() {
@Override
public boolean accept(XDMValue value) throws SystemException {
@@ -53,7 +52,7 @@
return false;
}
XDMNode node = (XDMNode) value;
- return (target == null || target.equals(nameCache.getLocalName(node.getNodeNameCode()).toString()));
+ return (target == null || target.equals(node.getNodeName().getLocalName()));
}
};
}
Modified: incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/QuantifiedType.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/QuantifiedType.java?rev=891081&r1=891080&r2=891081&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/QuantifiedType.java (original)
+++ incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/QuantifiedType.java Wed Dec 16 00:20:47 2009
@@ -1,23 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.vxquery.types;
import org.apache.vxquery.context.StaticContext;
-import org.apache.vxquery.datamodel.NameCache;
import org.apache.vxquery.datamodel.XDMValue;
import org.apache.vxquery.datamodel.atomic.AtomicValueFactory;
import org.apache.vxquery.exceptions.ErrorCode;
@@ -45,7 +44,7 @@
}
@Override
- public Filter<XDMValue> createInstanceOfFilter(NameCache nameCache) {
+ public Filter<XDMValue> createInstanceOfFilter() {
return null;
}
Modified: incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/TextType.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/TextType.java?rev=891081&r1=891080&r2=891081&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/TextType.java (original)
+++ incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/TextType.java Wed Dec 16 00:20:47 2009
@@ -1,23 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.vxquery.types;
import org.apache.vxquery.datamodel.DMOKind;
-import org.apache.vxquery.datamodel.NameCache;
import org.apache.vxquery.datamodel.XDMValue;
import org.apache.vxquery.exceptions.SystemException;
import org.apache.vxquery.util.Filter;
@@ -44,7 +43,7 @@
}
@Override
- public Filter<XDMValue> createInstanceOfFilter(NameCache nameCache) {
+ public Filter<XDMValue> createInstanceOfFilter() {
return TEXT_FILTER;
}
}
\ No newline at end of file
Modified: incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/XQType.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/XQType.java?rev=891081&r1=891080&r2=891081&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/XQType.java (original)
+++ incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/types/XQType.java Wed Dec 16 00:20:47 2009
@@ -16,13 +16,12 @@
*/
package org.apache.vxquery.types;
-import org.apache.vxquery.datamodel.NameCache;
import org.apache.vxquery.datamodel.XDMValue;
import org.apache.vxquery.types.processors.CastProcessor;
import org.apache.vxquery.util.Filter;
public interface XQType {
- public Filter<XDMValue> createInstanceOfFilter(NameCache nameCache);
+ public Filter<XDMValue> createInstanceOfFilter();
public CastProcessor getCastProcessor(XQType inputBaseType);
}
\ No newline at end of file
Modified: incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCodeGenerator.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCodeGenerator.java?rev=891081&r1=891080&r2=891081&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCodeGenerator.java (original)
+++ incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCodeGenerator.java Wed Dec 16 00:20:47 2009
@@ -22,7 +22,6 @@
import java.util.List;
import java.util.Map;
-import org.apache.vxquery.compiler.CompilerControlBlock;
import org.apache.vxquery.compiler.expression.AttributeNodeConstructorExpression;
import org.apache.vxquery.compiler.expression.CastExpression;
import org.apache.vxquery.compiler.expression.CastableExpression;
@@ -100,7 +99,7 @@
import org.apache.vxquery.util.Filter;
class XMLQueryCodeGenerator {
- public static void codegenModule(CompilerControlBlock ccb, Module module) {
+ public static void codegenModule(Module module) {
StaticContext sCtx = module.getModuleContext();
List<PrologVariable> prologVars = new ArrayList<PrologVariable>();
Map<Variable, Integer> gVarMap = new HashMap<Variable, Integer>();
@@ -116,7 +115,7 @@
if (initExpr != null) {
RegisterAllocator varPlanRegAllocator = new RegisterAllocator(0);
Map<Variable, Integer> varPlanVarMap = new HashMap<Variable, Integer>(gVarMap);
- varPlan = createPlan(initExpr, varPlanRegAllocator, varPlanVarMap, ccb);
+ varPlan = createPlan(initExpr, varPlanRegAllocator, varPlanVarMap);
}
PrologVariable gVar = new PrologVariable(v, varPlan);
prologVars.add(gVar);
@@ -133,7 +132,7 @@
for (ParameterVariable pVar : udf.getParameters()) {
fnPlanVarMap.put(pVar, fnPlanRegAllocator.allocate(1));
}
- RuntimePlan fnPlan = createPlan(fnExpr, fnPlanRegAllocator, fnPlanVarMap, ccb);
+ RuntimePlan fnPlan = createPlan(fnExpr, fnPlanRegAllocator, fnPlanVarMap);
udf.setRuntimePlan(fnPlan);
}
}
@@ -141,14 +140,13 @@
if (body != null) {
RegisterAllocator planRegAllocator = new RegisterAllocator(0);
Map<Variable, Integer> planVarMap = new HashMap<Variable, Integer>(gVarMap);
- RuntimePlan bodyPlan = createPlan(body, planRegAllocator, planVarMap, ccb);
+ RuntimePlan bodyPlan = createPlan(body, planRegAllocator, planVarMap);
module.setBodyRuntimePlan(bodyPlan);
}
}
- private static RuntimePlan createPlan(Expression expr, RegisterAllocator rAllocator, Map<Variable, Integer> varMap,
- CompilerControlBlock ccb) {
- ExpressionCodeGenerator ecg = new ExpressionCodeGenerator(rAllocator, varMap, ccb);
+ private static RuntimePlan createPlan(Expression expr, RegisterAllocator rAllocator, Map<Variable, Integer> varMap) {
+ ExpressionCodeGenerator ecg = new ExpressionCodeGenerator(rAllocator, varMap);
RuntimeIterator ri = expr.accept(ecg);
return new RuntimePlan(ri, rAllocator.getAllocatedRegisterCount());
}
@@ -156,12 +154,10 @@
private static final class ExpressionCodeGenerator implements ExpressionVisitor<RuntimeIterator> {
private final RegisterAllocator rAllocator;
private final Map<Variable, Integer> varRegMap;
- private final CompilerControlBlock ccb;
- ExpressionCodeGenerator(RegisterAllocator rAllocator, Map<Variable, Integer> varRegMap, CompilerControlBlock ccb) {
+ ExpressionCodeGenerator(RegisterAllocator rAllocator, Map<Variable, Integer> varRegMap) {
this.rAllocator = rAllocator;
this.varRegMap = varRegMap;
- this.ccb = ccb;
}
@Override
@@ -290,7 +286,7 @@
@Override
public RuntimeIterator visitInstanceofExpression(InstanceofExpression expr) {
- Filter<XDMValue> filter = expr.getType().toXQType().createInstanceOfFilter(ccb.getNameCache());
+ Filter<XDMValue> filter = expr.getType().toXQType().createInstanceOfFilter();
RuntimeIterator ii = expr.getInput().accept(this);
return new InstanceOfIterator(rAllocator, ii, filter);
}
@@ -369,7 +365,7 @@
@Override
public RuntimeIterator visitPathStepExpression(PathStepExpression expr) {
RuntimeIterator in = expr.getInput().accept(this);
- Filter<XDMValue> typeFilter = expr.getNodeType().createInstanceOfFilter(ccb.getNameCache());
+ Filter<XDMValue> typeFilter = expr.getNodeType().createInstanceOfFilter();
switch (expr.getAxis()) {
case ANCESTOR:
return new AncestorAxisIterator(rAllocator, in, typeFilter);
Modified: incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java?rev=891081&r1=891080&r2=891081&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java (original)
+++ incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java Wed Dec 16 00:20:47 2009
@@ -1,19 +1,19 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.vxquery.xmlquery.query;
import org.apache.vxquery.compiler.CompilerControlBlock;
@@ -34,7 +34,7 @@
listener.notifyTranslationResult(module);
XMLQueryTypeChecker.typeCheckModule(module);
listener.notifyTypecheckResult(module);
- XMLQueryCodeGenerator.codegenModule(ccb, module);
+ XMLQueryCodeGenerator.codegenModule(module);
listener.notifyCodegenResult(module);
return module;
}
Modified: incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryTranslator.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryTranslator.java?rev=891081&r1=891080&r2=891081&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryTranslator.java (original)
+++ incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryTranslator.java Wed Dec 16 00:20:47 2009
@@ -699,7 +699,7 @@
}
private Expression translateExpression(ASTNode value) throws SystemException {
- final AtomicValueFactory avf = ccb.getAtomicValueFactory();
+ final AtomicValueFactory avf = ccb.getDatamodelStaticInterface().getAtomicValueFactory();
switch (value.getTag()) {
case EXPRESSION: {
ExprNode node = (ExprNode) value;
Modified: incubator/vxquery/trunk/vxquery/src/test/java/org/apache/vxquery/xmlquery/query/SimpleXQueryTest.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/test/java/org/apache/vxquery/xmlquery/query/SimpleXQueryTest.java?rev=891081&r1=891080&r2=891081&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/test/java/org/apache/vxquery/xmlquery/query/SimpleXQueryTest.java (original)
+++ incubator/vxquery/trunk/vxquery/src/test/java/org/apache/vxquery/xmlquery/query/SimpleXQueryTest.java Wed Dec 16 00:20:47 2009
@@ -1,19 +1,19 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.vxquery.xmlquery.query;
import java.io.BufferedInputStream;
@@ -26,16 +26,16 @@
import junit.framework.Assert;
-import org.junit.Test;
-
import org.apache.vxquery.api.InternalAPI;
import org.apache.vxquery.datamodel.DMOKind;
import org.apache.vxquery.datamodel.XDMItem;
import org.apache.vxquery.datamodel.XDMSequence;
import org.apache.vxquery.datamodel.XDMValue;
+import org.apache.vxquery.datamodel.dtm.DTMDatamodelStaticInterfaceImpl;
import org.apache.vxquery.exceptions.SystemException;
import org.apache.vxquery.runtime.base.CloseableIterator;
import org.apache.vxquery.runtime.base.OpenableCloseableIterator;
+import org.junit.Test;
public class SimpleXQueryTest {
@Test
@@ -116,20 +116,20 @@
@Test
public void simple016() {
// TODO unzipping every time is a little slow ...
- String temp = gunzip("src/test/resources/documents/", "dblp.xml");
+ String temp = gunzip("src/test/resources/documents/", "dblp.xml");
runTest("simple016", "string-length(doc('" + temp + "'))");
}
private static String gunzip(String dir, String filename) {
try {
- GZIPInputStream in = new GZIPInputStream(new BufferedInputStream(new FileInputStream(new File(
- dir + filename + ".gz"))));
+ GZIPInputStream in = new GZIPInputStream(new BufferedInputStream(new FileInputStream(new File(dir
+ + filename + ".gz"))));
File temp = File.createTempFile("vxquery", filename);
temp.deleteOnExit();
FileOutputStream out = new FileOutputStream(temp);
byte[] buf = new byte[1024];
int len;
- while ((len = in.read(buf)) > 0){
+ while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
in.close();
@@ -159,9 +159,8 @@
}
private static void runTestInternal(String testName, String query) throws SystemException {
- InternalAPI iapi = new InternalAPI();
- OpenableCloseableIterator ri = iapi.execute(iapi.compile(null, iapi
- .parse(testName, new StringReader(query))));
+ InternalAPI iapi = new InternalAPI(new DTMDatamodelStaticInterfaceImpl());
+ OpenableCloseableIterator ri = iapi.execute(iapi.compile(null, iapi.parse(testName, new StringReader(query))));
ri.open();
System.err.println("--- Results begin");
XDMValue o;
Modified: incubator/vxquery/trunk/vxquery/src/test/java/org/apache/vxquery/xtest/TestRunnerFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/test/java/org/apache/vxquery/xtest/TestRunnerFactory.java?rev=891081&r1=891080&r2=891081&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/test/java/org/apache/vxquery/xtest/TestRunnerFactory.java (original)
+++ incubator/vxquery/trunk/vxquery/src/test/java/org/apache/vxquery/xtest/TestRunnerFactory.java Wed Dec 16 00:20:47 2009
@@ -31,6 +31,7 @@
import org.apache.vxquery.api.InternalAPI;
import org.apache.vxquery.compiler.expression.GlobalVariable;
import org.apache.vxquery.datamodel.XDMItem;
+import org.apache.vxquery.datamodel.dtm.DTMDatamodelStaticInterfaceImpl;
import org.apache.vxquery.datamodel.serialization.XMLSerializer;
import org.apache.vxquery.runtime.base.OpenableCloseableIterator;
import org.apache.vxquery.runtime.core.Deflater;
@@ -56,7 +57,7 @@
TestCaseResult res = new TestCaseResult(testCase);
long start = System.currentTimeMillis();
try {
- InternalAPI iapi = new InternalAPI();
+ InternalAPI iapi = new InternalAPI(new DTMDatamodelStaticInterfaceImpl());
FileReader in = new FileReader(testCase.getXQueryFile());
ModuleNode ast;
try {