/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Copyright 2001, 2002,2004,2005 The Apache Software Foundation.
*
* Licensed 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
*
*
* 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.
*/
/**
* Schema identity constraint selector.
*
* @xerces.internal
*
* @author Andy Clark, IBM
* @version $Id: Selector.java,v 1.7 2010-11-01 04:39:57 joehw Exp $
*/
public class Selector {
//
// Data
//
/** XPath. */
/** Identity constraint. */
// the Identity constraint we're the matcher for. Only
// used for selectors!
//
// Constructors
//
/** Constructs a selector. */
} // <init>(Selector.XPath,IdentityConstraint)
//
// Public methods
//
/** Returns the selector XPath. */
return fXPath;
} // getXPath():com.sun.org.apache.xerces.internal.v1.schema.identity.XPath
/** Returns the identity constraint. */
return fIdentityConstraint;
} // getIDConstraint():IdentityConstraint
// factory method
/** Creates a selector matcher.
* @param activator The activator for this selector's fields.
* @param initialDepth The depth in the document at which this matcher began its life;
* used in correctly handling recursive elements.
*/
} // createMatcher(FieldActivator):XPathMatcher
//
// Object methods
//
/** Returns a string representation of this object. */
} // toString():String
//
// Classes
//
/**
* Schema identity constraint selector XPath expression.
*
* @author Andy Clark, IBM
* @version $Id: Selector.java,v 1.7 2010-11-01 04:39:57 joehw Exp $
*/
public static class XPath
//
// Constructors
//
/** Constructs a selector XPath expression. */
// verify that an attribute is not selected
throw new XPathException("c-selector-xpath");
}
}
} // <init>(String,SymbolTable,NamespacesScope)
// NOTE: We have to prefix the selector XPath with "./" in
// order to handle selectors such as "." that select
// the element container because the fields could be
// relative to that element. -Ac
// Unless xpath starts with a descendant node -Achille Fokoue
// ... or a '.' or a '/' - NG
// And we also need to prefix exprs to the right of | with ./ - NG
int unionIndex = -1;
do {
}
if(unionIndex == -1) {
break;
}
} while(true);
return modifiedXPath.toString();
}
} // class Selector.XPath
/**
* Selector matcher.
*
* @author Andy Clark, IBM
*/
public class Matcher
extends XPathMatcher {
//
// Data
//
/** Field activator. */
/** Initial depth in the document at which this matcher was created. */
protected final int fInitialDepth;
/** Element depth. */
protected int fElementDepth;
/** Depth at match. */
protected int fMatchedDepth;
//
// Constructors
//
/** Constructs a selector matcher. */
int initialDepth) {
super(xpath);
} // <init>(Selector.XPath,FieldActivator)
//
// XMLDocumentFragmentHandler methods
//
public void startDocumentFragment(){
super.startDocumentFragment();
fElementDepth = 0;
fMatchedDepth = -1;
} // startDocumentFragment()
/**
* The start of an element. If the document specifies the start element
* by using an empty tag, then the startElement method will immediately
* be followed by the endElement method, with no intervening methods.
*
* @param element The name of the element.
* @param attributes The element attributes.
*
*/
// activate the fields, if selector is matched
//int matched = isMatched();
if (isMatched()) {
/* (fMatchedDepth == -1 && ((matched & MATCHED) == MATCHED)) ||
((matched & MATCHED_DESCENDANT) == MATCHED_DESCENDANT)) { */
for (int i = 0; i < count; i++) {
}
}
} // startElement(QName,XMLAttrList,int)
public void endElement(QName element, XSTypeDefinition type, boolean nillable, Object actualValue, short valueType, ShortList itemValueType) {
if (fElementDepth-- == fMatchedDepth) {
fMatchedDepth = -1;
}
}
/** Returns the identity constraint. */
return fIdentityConstraint;
} // getIdentityConstraint():IdentityConstraint
/** get the initial depth at which this selector matched. */
public int getInitialDepth() {
return fInitialDepth;
} // getInitialDepth(): int
} // class Matcher
} // class Selector