Package org.apache.jackrabbit.name

Examples of org.apache.jackrabbit.name.QName


  final public void ContainsExpression() throws ParseException {
/*@bgen(jjtree) ContainsExpression */
  ASTContainsExpression jjtn000 = new ASTContainsExpression(JJTCONTAINSEXPRESSION);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token t = null;
  QName name = null;
    try {
      jj_consume_token(CONTAINS);
      jj_consume_token(LEFT_PAREN);
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case ASTERISK:
View Full Code Here


  final public QName Identifier() throws ParseException {
/*@bgen(jjtree) Identifier */
  ASTIdentifier jjtn000 = new ASTIdentifier(JJTIDENTIFIER);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token t = null;
  QName name = null;
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case REGULAR_IDENTIFIER:
        t = jj_consume_token(REGULAR_IDENTIFIER);
        try {
View Full Code Here

import java.util.Map;

public class AbstractTextFilterTest {

    public void showResult(File file, TextFilter filter) throws Exception {
        PropertyId id = new PropertyId(null, new QName("", ""));
        PropertyState state = new PropertyState(id, 1, true);

        InternalValue value = InternalValue.create(file);
        state.setValues(new InternalValue[]{value});
View Full Code Here

import java.util.Map;

public class AbstractTextFilterTest {

    public void showResult(File file, TextFilter filter) throws Exception {
        PropertyId id = new PropertyId(null, new QName("", ""));
        PropertyState state = new PropertyState(id, 1, true);

        InternalValue value = InternalValue.create(file);
        state.setValues(new InternalValue[]{value});
View Full Code Here

public class XMLTextFilterTest extends TestCase {

    public void testCanExtractAttributes() throws Exception {
        String xml = "<config><city name=\"Stockholm\"/></config>";
        PropertyId id = new PropertyId(new NodeId(new UUID(1, 1)), new QName("", ""));
        PropertyState state = new PropertyState(id, 1, true);

        InternalValue value = InternalValue.create(xml.getBytes());
        state.setValues(new InternalValue[]{value});
View Full Code Here

        assertEquals("Stockholm", result.trim());
    }

    public void testCanExtractCData() throws Exception {
        String xml = "<config><city>Stockholm</city></config>";
        PropertyId id = new PropertyId(new NodeId(new UUID(1, 1)), new QName("", ""));
        PropertyState state = new PropertyState(id, 1, true);

        InternalValue value = InternalValue.create(xml.getBytes());
        state.setValues(new InternalValue[]{value});
View Full Code Here

     * @return true if the specified node is <i>referenceable</i>, false otherwise.
     * @throws ItemStateException if an error occurs
     */
    private boolean isReferenceable(NodeState state) throws ItemStateException {
        // shortcut: check some wellknown built-in types first
        QName primary = state.getNodeTypeName();
        Set mixins = state.getMixinTypeNames();
        if (mixins.contains(QName.MIX_REFERENCEABLE)
                || mixins.contains(QName.MIX_VERSIONABLE)
                || primary.equals(QName.NT_RESOURCE)) {
            return true;
        }
        // build effective node type
        QName[] types = new QName[mixins.size() + 1];
        mixins.toArray(types);
View Full Code Here

                Set tmp = new HashSet();
                tmp.addAll(Arrays.asList(properties));
                propertySet = tmp;
            }
            try {
                QName prop = NameFormat.parse(propertyName, resolver);
                if (!propertySet.contains(prop)) {
                    throw new ItemNotFoundException(propertyName);
                }
                if (node.hasProperty(prop)) {
                    Property p = node.getProperty(prop);
View Full Code Here

            case JJTTYPENAME:
                if (queryNode.getType() == QueryNode.TYPE_LOCATION) {
                    LocationStepQueryNode loc = (LocationStepQueryNode) queryNode;
                    String ntName = ((SimpleNode) node.jjtGetChild(0)).getValue();
                    try {
                        QName nt = NameFormat.parse(ntName, resolver);
                        NodeTypeQueryNode nodeType = new NodeTypeQueryNode(loc, nt);
                        loc.addPredicate(nodeType);
                    } catch (IllegalNameException e) {
                        exceptions.add(new InvalidQueryException("Not a valid name: " + ntName));
                    } catch (UnknownPrefixException e) {
View Full Code Here

        if (node.jjtGetNumChildren() > 0) {
            SimpleNode child = (SimpleNode) node.jjtGetChild(0);
            if (child.getId() == JJTQNAME || child.getId() == JJTQNAMEFORITEMTYPE) {
                try {
                    if (queryNode.getType() == QueryNode.TYPE_LOCATION) {
                        QName name = ISO9075.decode(NameFormat.parse(child.getValue(), resolver));
                        if (name.equals(JCR_ROOT)) {
                            name = LocationStepQueryNode.EMPTY_NAME;
                        }
                        ((LocationStepQueryNode) queryNode).setNameTest(name);
                    } else if (queryNode.getType() == QueryNode.TYPE_DEREF) {
                        QName name = ISO9075.decode(NameFormat.parse(child.getValue(), resolver));
                        ((DerefQueryNode) queryNode).setRefProperty(name);
                    } else if (queryNode.getType() == QueryNode.TYPE_RELATION) {
                        QName name = ISO9075.decode(NameFormat.parse(child.getValue(), resolver));
                        ((RelationQueryNode) queryNode).setProperty(name);
                    } else if (queryNode.getType() == QueryNode.TYPE_PATH) {
                        QName name = ISO9075.decode(NameFormat.parse(child.getValue(), resolver));
                        root.addSelectProperty(name);
                    } else if (queryNode.getType() == QueryNode.TYPE_ORDER) {
                        QName name = ISO9075.decode(NameFormat.parse(child.getValue(), resolver));
                        root.getOrderNode().addOrderSpec(name, true);
                    } else if (queryNode.getType() == QueryNode.TYPE_TEXTSEARCH) {
                        QName name = ISO9075.decode(NameFormat.parse(child.getValue(), resolver));
                        ((TextsearchQueryNode) queryNode).setPropertyName(name);
                    }
                } catch (IllegalNameException e) {
                    exceptions.add(new InvalidQueryException("Illegal name: " + child.getValue()));
                } catch (UnknownPrefixException e) {
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.name.QName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.