本文整理汇总了Java中com.sun.org.apache.xerces.internal.xni.QName类的典型用法代码示例。如果您正苦于以下问题:Java QName类的具体用法?Java QName怎么用?Java QName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QName类属于com.sun.org.apache.xerces.internal.xni包,在下文中一共展示了QName类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
}
}
}
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:XMLStreamWriterImpl.java
示例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++];
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:XMLDocumentFragmentScannerImpl.java
示例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);
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:JAXPValidatorComponent.java
示例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);
}
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:XMLSchemaValidator.java
示例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;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:DTDGrammar.java
示例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);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:ValidatorHandlerImpl.java
示例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]);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:XMLDocumentFragmentScannerImpl.java
示例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);
}
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:35,代码来源:XMLSchemaValidator.java
示例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();
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:XMLNSDTDValidator.java
示例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;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:SimpleContentModel.java
示例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;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:AbstractDOMParser.java
示例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;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:XSAllCM.java
示例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 ;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:35,代码来源:ShortHandPointer.java
示例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;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:XMLSchemaValidator.java
示例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];
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:XMLDocumentFragmentScannerImpl.java
示例16: 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
*
* @exception XNIException
* Thrown by handler to signal an error.
*/
public void endElement(QName element, Augmentations augs) throws XNIException {
// when we reach the endElement of xs:appinfo or xs:documentation,
// change fInnerAnnotationDepth to -1
if(fAnnotationDepth > -1) {
if (fInnerAnnotationDepth == fDepth) {
fInnerAnnotationDepth = -1;
schemaDOM.endAnnotationElement(element);
schemaDOM.endElement();
} else if (fAnnotationDepth == fDepth) {
fAnnotationDepth = -1;
schemaDOM.endAnnotation(element, fCurrentAnnotationElement);
schemaDOM.endElement();
} else { // inside a child of annotation
schemaDOM.endAnnotationElement(element);
}
} else { // not in an annotation at all
if(element.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA && fGenerateSyntheticAnnotation) {
boolean value = fHasNonSchemaAttributes.pop();
boolean sawann = fSawAnnotation.pop();
if (value && !sawann) {
String schemaPrefix = fNamespaceContext.getPrefix(SchemaSymbols.URI_SCHEMAFORSCHEMA);
final String annRawName = (schemaPrefix.length() == 0) ? SchemaSymbols.ELT_ANNOTATION : (schemaPrefix + ':' + SchemaSymbols.ELT_ANNOTATION);
schemaDOM.startAnnotation(annRawName, fEmptyAttr, fNamespaceContext);
final String elemRawName = (schemaPrefix.length() == 0) ? SchemaSymbols.ELT_DOCUMENTATION : (schemaPrefix + ':' + SchemaSymbols.ELT_DOCUMENTATION);
schemaDOM.startAnnotationElement(elemRawName, fEmptyAttr);
schemaDOM.charactersRaw("SYNTHETIC_ANNOTATION");
schemaDOM.endSyntheticAnnotationElement(elemRawName, false);
schemaDOM.endSyntheticAnnotationElement(annRawName, true);
}
}
schemaDOM.endElement();
}
fDepth--;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:46,代码来源:SchemaDOMParser.java
示例17: createAttributeDecl
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
protected int createAttributeDecl() {
int chunk = fAttributeDeclCount >> CHUNK_SHIFT;
int index = fAttributeDeclCount & CHUNK_MASK;
ensureAttributeDeclCapacity(chunk);
fAttributeDeclName[chunk][index] = new QName();
fAttributeDeclType[chunk][index] = -1;
fAttributeDeclEnumeration[chunk][index] = null;
fAttributeDeclDefaultType[chunk][index] = XMLSimpleType.DEFAULT_TYPE_IMPLIED;
fAttributeDeclDefaultValue[chunk][index] = null;
fAttributeDeclNonNormalizedDefaultValue[chunk][index] = null;
fAttributeDeclNextAttributeDeclIndex[chunk][index] = -1;
return fAttributeDeclCount++;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:DTDGrammar.java
示例18: XMLDTDValidator
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
/** Default constructor. */
public XMLDTDValidator() {
// initialize data
for (int i = 0; i < fElementQNamePartsStack.length; i++) {
fElementQNamePartsStack[i] = new QName();
}
fGrammarBucket = new DTDGrammarBucket();
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:XMLDTDValidator.java
示例19: rootElementSpecified
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
/** Root element specified. */
private final void rootElementSpecified(QName rootElement) throws XNIException {
if (fPerformValidation) {
String root1 = fRootElement.rawname;
String root2 = rootElement.rawname;
if (root1 == null || !root1.equals(root2)) {
fErrorReporter.reportError( XMLMessageFormatter.XML_DOMAIN,
"RootElementTypeMustMatchDoctypedecl",
new Object[]{root1, root2},
XMLErrorReporter.SEVERITY_ERROR);
}
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:XMLDTDValidator.java
示例20: updateAttributes
import com.sun.org.apache.xerces.internal.xni.QName; //导入依赖的package包/类
/**
* Compares the given {@link Attributes} with {@link #fCurrentAttributes}
* and update the latter accordingly.
*/
private void updateAttributes( Attributes atts ) {
int len = atts.getLength();
for( int i=0; i<len; i++ ) {
String aqn = atts.getQName(i);
int j = fCurrentAttributes.getIndex(aqn);
String av = atts.getValue(i);
if(j==-1) {
// newly added attribute. add to the current attribute list.
String prefix;
int idx = aqn.indexOf(':');
if( idx<0 ) {
prefix = null;
} else {
prefix = symbolize(aqn.substring(0,idx));
}
j = fCurrentAttributes.addAttribute(
new QName(
prefix,
symbolize(atts.getLocalName(i)),
symbolize(aqn),
symbolize(atts.getURI(i))),
atts.getType(i),av);
} else {
// the attribute is present.
if( !av.equals(fCurrentAttributes.getValue(j)) ) {
// but the value was changed.
fCurrentAttributes.setValue(j,av);
}
}
/** Augmentations augs = fCurrentAttributes.getAugmentations(j);
augs.putItem( Constants.TYPEINFO,
typeInfoProvider.getAttributeTypeInfo(i) );
augs.putItem( Constants.ID_ATTRIBUTE,
typeInfoProvider.isIdAttribute(i)?Boolean.TRUE:Boolean.FALSE ); **/
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:44,代码来源:JAXPValidatorComponent.java
注:本文中的com.sun.org.apache.xerces.internal.xni.QName类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论