本文整理汇总了Java中com.sun.org.apache.xerces.internal.xni.QName类的典型用法代码示例。如果您正苦于以下问题:Java QName类的具体用法?Java QName怎么用?Java QName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QName类属于com.sun.org.apache.xerces.internal.xni包,在下文中一共展示了QName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: repairNamespaceDecl
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
void repairNamespaceDecl(QName attr) {
QName decl;
String tmpURI;
//check for null prefix.
for (int j = 0; j < fNamespaceDecls.size(); j++) {
decl = fNamespaceDecls.get(j);
if (decl != null) {
if ((attr.prefix != null) &&
(attr.prefix.equals(decl.prefix) &&
!(attr.uri.equals(decl.uri)))) {
tmpURI = fNamespaceContext.getNamespaceURI(attr.prefix);
//see if you need to add to symbole table.
if (tmpURI != null) {
if (tmpURI.equals(attr.uri)) {
fNamespaceDecls.set(j, null);
} else {
decl.uri = attr.uri;
}
}
}
}
}
}
示例2: nextElement
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
/**
* Returns the next element on the stack.
*
* @return Returns the actual QName object. Callee should
* use this object to store the details of next element encountered.
*/
public QName nextElement() {
if(fSkip){
fDepth++;
//boundary checks are done in matchElement()
return fElements[fCount++];
} else if (fDepth == fElements.length) {
QName[] array = new QName[fElements.length * 2];
System.arraycopy(fElements, 0, array, 0, fDepth);
fElements = array;
for (int i = fDepth; i < fElements.length; i++) {
fElements[i] = new QName();
}
}
return fElements[fDepth++];
}
示例3: endElement
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
public void endElement(QName element, Augmentations augs) throws XNIException {
try {
String uri = element.uri != null ? element.uri : "";
String localpart = element.localpart;
fContentHandler.endElement(uri, localpart, element.rawname);
// send endPrefixMapping events
int count = fNamespaceContext.getDeclaredPrefixCount();
if (count > 0) {
for (int i = 0; i < count; i++) {
fContentHandler.endPrefixMapping(fNamespaceContext.getDeclaredPrefixAt(i));
}
}
} catch( SAXException e ) {
throw new XNIException(e);
}
}
示例4: endElement
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
/**
* The end of an element.
*
* @param element The name of the element.
* @param augs Additional information that may include infoset augmentations
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void endElement(QName element, Augmentations augs) throws XNIException {
// in the case where there is a {value constraint}, and the element
// doesn't have any text content, add a characters call.
fDefaultValue = null;
Augmentations modifiedAugs = handleEndElement(element, augs);
// call handlers
if (fDocumentHandler != null) {
if (!fSchemaElementDefault || fDefaultValue == null) {
fDocumentHandler.endElement(element, modifiedAugs);
} else {
fDocumentHandler.characters(fDefaultValue, null);
fDocumentHandler.endElement(element, modifiedAugs);
}
}
}
示例5: ensureAttributeDeclCapacity
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
private void ensureAttributeDeclCapacity(int chunk) {
if (chunk >= fAttributeDeclName.length) {
fAttributeDeclName = resize(fAttributeDeclName, fAttributeDeclName.length * 2);
fAttributeDeclType = resize(fAttributeDeclType, fAttributeDeclType.length * 2);
fAttributeDeclEnumeration = resize(fAttributeDeclEnumeration, fAttributeDeclEnumeration.length * 2);
fAttributeDeclDefaultType = resize(fAttributeDeclDefaultType, fAttributeDeclDefaultType.length * 2);
fAttributeDeclDefaultValue = resize(fAttributeDeclDefaultValue, fAttributeDeclDefaultValue.length * 2);
fAttributeDeclNonNormalizedDefaultValue = resize(fAttributeDeclNonNormalizedDefaultValue, fAttributeDeclNonNormalizedDefaultValue.length * 2);
fAttributeDeclNextAttributeDeclIndex = resize(fAttributeDeclNextAttributeDeclIndex, fAttributeDeclNextAttributeDeclIndex.length * 2);
}
else if (fAttributeDeclName[chunk] != null) {
return;
}
fAttributeDeclName[chunk] = new QName[CHUNK_SIZE];
fAttributeDeclType[chunk] = new short[CHUNK_SIZE];
fAttributeDeclEnumeration[chunk] = new String[CHUNK_SIZE][];
fAttributeDeclDefaultType[chunk] = new short[CHUNK_SIZE];
fAttributeDeclDefaultValue[chunk] = new String[CHUNK_SIZE];
fAttributeDeclNonNormalizedDefaultValue[chunk] = new String[CHUNK_SIZE];
fAttributeDeclNextAttributeDeclIndex[chunk] = new int[CHUNK_SIZE];
return;
}
示例6: fillQName
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
/** Fills in a QName object. */
private void fillQName(QName toFill, String uri, String localpart, String raw) {
if (!fStringsInternalized) {
uri = (uri != null && uri.length() > 0) ? fSymbolTable.addSymbol(uri) : null;
localpart = (localpart != null) ? fSymbolTable.addSymbol(localpart) : XMLSymbols.EMPTY_STRING;
raw = (raw != null) ? fSymbolTable.addSymbol(raw) : XMLSymbols.EMPTY_STRING;
}
else {
if (uri != null && uri.length() == 0) {
uri = null;
}
if (localpart == null) {
localpart = XMLSymbols.EMPTY_STRING;
}
if (raw == null) {
raw = XMLSymbols.EMPTY_STRING;
}
}
String prefix = XMLSymbols.EMPTY_STRING;
int prefixIdx = raw.indexOf(':');
if (prefixIdx != -1) {
prefix = fSymbolTable.addSymbol(raw.substring(0, prefixIdx));
}
toFill.setValues(prefix, localpart, raw, uri);
}
示例7: popElement
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
/**
* Pops an element off of the stack by setting the values of
* the specified QName.
* <p>
* <strong>Note:</strong> The object returned is <em>not</em>
* orphaned to the caller. Therefore, the caller should consider
* the object to be read-only.
*/
public QName popElement() {
//return the same object that was pushed -- this would avoid
//setting the values for every end element.
//STRONG: this object is read only -- this object reference shouldn't be stored.
if(fSkip || fAdd ){
if(DEBUG_SKIP_ALGORITHM){
System.out.println("POPPING Element, at position " + fInt[fDepth] + " element at that count is = " + fElements[fInt[fDepth]].rawname);
System.out.println("");
}
return fElements[fInt[fDepth--]];
} else{
if(DEBUG_SKIP_ALGORITHM){
System.out.println("Retrieveing element at depth = " + fDepth + " is " + fElements[fDepth].rawname );
}
return fElements[--fDepth] ;
}
//element.setValues(fElements[--fDepth]);
}
示例8: emptyElement
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
/**
* An empty element.
*
* @param element The name of the element.
* @param attributes The element attributes.
* @param augs Additional information that may include infoset augmentations
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
throws XNIException {
Augmentations modifiedAugs = handleStartElement(element, attributes, augs);
// in the case where there is a {value constraint}, and the element
// doesn't have any text content, change emptyElement call to
// start + characters + end
fDefaultValue = null;
// fElementDepth == -2 indicates that the schema validator was removed
// from the pipeline. then we don't need to call handleEndElement.
if (fElementDepth != -2)
modifiedAugs = handleEndElement(element, modifiedAugs);
// call handlers
if (fDocumentHandler != null) {
if (!fSchemaElementDefault || fDefaultValue == null) {
fDocumentHandler.emptyElement(element, attributes, modifiedAugs);
} else {
fDocumentHandler.startElement(element, attributes, modifiedAugs);
fDocumentHandler.characters(fDefaultValue, null);
fDocumentHandler.endElement(element, modifiedAugs);
}
}
}
示例9: endNamespaceScope
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
/** Handles end element. */
protected void endNamespaceScope(QName element, Augmentations augs, boolean isEmpty)
throws XNIException {
// bind element
String eprefix = element.prefix != null ? element.prefix : XMLSymbols.EMPTY_STRING;
element.uri = fNamespaceContext.getURI(eprefix);
if (element.uri != null) {
element.prefix = eprefix;
}
// call handlers
if (fDocumentHandler != null) {
if (!isEmpty) {
fDocumentHandler.endElement(element, augs);
}
}
// pop context
fNamespaceContext.popContext();
}
示例10: SimpleContentModel
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
/**
* Constructs a simple content model.
*
* @param operator The content model operator.
* @param firstChild qualified name of the first child
* @param secondChild qualified name of the second child
*
*/
public SimpleContentModel(short operator, QName firstChild, QName secondChild) {
//
// Store away the children and operation. This is all we need to
// do the content model check.
//
// The operation is one of the ContentSpecNode.NODE_XXX values!
//
fFirstChild.setValues(firstChild);
if (secondChild != null) {
fSecondChild.setValues(secondChild);
}
else {
fSecondChild.clear();
}
fOperator = operator;
}
示例11: createAttrNode
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
protected Attr createAttrNode (QName attrQName) {
Attr attr = null;
if (fNamespaceAware) {
if (fDocumentImpl != null) {
// if we are using xerces DOM implementation, call our
// own constructor to reuse the strings we have here.
attr = fDocumentImpl.createAttributeNS (attrQName.uri,
attrQName.rawname,
attrQName.localpart);
}
else {
attr = fDocument.createAttributeNS (attrQName.uri,
attrQName.rawname);
}
}
else {
attr = fDocument.createAttribute (attrQName.rawname);
}
return attr;
}
示例12: findMatchingDecl
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler) {
Object matchingDecl = null;
for (int i = 0; i < fNumElements; i++) {
matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
if (matchingDecl != null)
break;
}
return matchingDecl;
}
示例13: resolveXPointer
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
public boolean resolveXPointer(QName element, XMLAttributes attributes,
Augmentations augs, int event) throws XNIException {
// reset fIsFragmentResolved
if (fMatchingChildCount == 0) {
fIsFragmentResolved = false;
}
// On startElement or emptyElement, if no matching elements or parent
// elements were found, check for a matching idenfitier.
if (event == XPointerPart.EVENT_ELEMENT_START) {
if (fMatchingChildCount == 0) {
fIsFragmentResolved = hasMatchingIdentifier(element, attributes, augs,
event);
}
if (fIsFragmentResolved) {
fMatchingChildCount++;
}
} else if (event == XPointerPart.EVENT_ELEMENT_EMPTY) {
if (fMatchingChildCount == 0) {
fIsFragmentResolved = hasMatchingIdentifier(element, attributes, augs,
event);
}
}
else {
// On endElement, decrease the matching child count if the child or
// its parent was resolved.
if (fIsFragmentResolved) {
fMatchingChildCount--;
}
}
return fIsFragmentResolved ;
}
示例14: getXsiNil
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
boolean getXsiNil(QName element, String xsiNil) {
// Element Locally Valid (Element)
// 3 The appropriate case among the following must be true:
// 3.1 If {nillable} is false, then there must be no attribute information item among the element information item's [attributes] whose [namespace name] is identical to http://www.w3.org/2001/XMLSchema-instance and whose [local name] is nil.
if (fCurrentElemDecl != null && !fCurrentElemDecl.getNillable()) {
reportSchemaError(
"cvc-elt.3.1",
new Object[] {
element.rawname,
SchemaSymbols.URI_XSI + "," + SchemaSymbols.XSI_NIL });
}
// 3.2 If {nillable} is true and there is such an attribute information item and its actual value is true , then all of the following must be true:
// 3.2.2 There must be no fixed {value constraint}.
else {
String value = XMLChar.trim(xsiNil);
if (value.equals(SchemaSymbols.ATTVAL_TRUE)
|| value.equals(SchemaSymbols.ATTVAL_TRUE_1)) {
if (fCurrentElemDecl != null
&& fCurrentElemDecl.getConstraintType() == XSConstants.VC_FIXED) {
reportSchemaError(
"cvc-elt.3.2.2",
new Object[] {
element.rawname,
SchemaSymbols.URI_XSI + "," + SchemaSymbols.XSI_NIL });
}
return true;
}
}
return false;
}
示例15: getNext
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
/** Note that this function is considerably different than nextElement()
* This function just returns the previously stored elements
*/
public QName getNext(){
//when position reaches number of elements in the list..
//set the position back to mark, making it a circular linked list.
if(fPosition == fCount){
fPosition = fMark;
}
//store the position of last opened tag at particular depth
//fInt[++fDepth] = fPosition;
if(DEBUG_SKIP_ALGORITHM){
System.out.println("Element at fPosition = " + fPosition + " is " + fElements[fPosition].rawname);
}
//return fElements[fPosition++];
return fElements[fPosition];
}