本文整理汇总了Java中com.sun.org.apache.xerces.internal.util.XMLStringBuffer.append方法的典型用法代码示例。如果您正苦于以下问题:Java XMLStringBuffer.append方法的具体用法?Java XMLStringBuffer.append怎么用?Java XMLStringBuffer.append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.org.apache.xerces.internal.util.XMLStringBuffer
的用法示例。
在下文中一共展示了XMLStringBuffer.append方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleCharacter
import com.sun.org.apache.xerces.internal.util.XMLStringBuffer; //导入方法依赖的package包/类
/**
* Calls document handler with a single character resulting from
* built-in entity resolution.
*
* @param c
* @param entity built-in name
* @param XMLStringBuffer append the character to buffer
*
* we really dont need to call this function -- this function is only required when
* we integrate with rest of Xerces2. SO maintaining the current behavior and still
* calling this function to hanlde built-in entity reference.
*
*/
private void handleCharacter(char c, String entity, XMLStringBuffer content) throws XNIException {
foundBuiltInRefs = true;
content.append(c);
if (fDocumentHandler != null) {
fSingleChar[0] = c;
if (fNotifyBuiltInRefs) {
fDocumentHandler.startGeneralEntity(entity, null, null, null);
}
fTempString.setValues(fSingleChar, 0, 1);
//fDocumentHandler.characters(fTempString, null);
if (fNotifyBuiltInRefs) {
fDocumentHandler.endGeneralEntity(entity, null);
}
}
}
示例2: handleCharacter
import com.sun.org.apache.xerces.internal.util.XMLStringBuffer; //导入方法依赖的package包/类
/**
* Calls document handler with a single character resulting from
* built-in entity resolution.
*
* @param c
* @param entity built-in name
* @param XMLStringBuffer append the character to buffer
*
* we really dont need to call this function -- this function is only required when
* we integrate with rest of Xerces2. SO maintaining the current behavior and still
* calling this function to hanlde built-in entity reference.
*
*/
private void handleCharacter(char c, String entity, XMLStringBuffer content) throws XNIException {
foundBuiltInRefs = true;
checkEntityLimit(false, fEntityScanner.fCurrentEntity.name, 1);
content.append(c);
if (fDocumentHandler != null) {
fSingleChar[0] = c;
if (fNotifyBuiltInRefs) {
fDocumentHandler.startGeneralEntity(entity, null, null, null);
}
fTempString.setValues(fSingleChar, 0, 1);
if(!fIsCoalesce){
fDocumentHandler.characters(fTempString, null);
builtInRefCharacterHandled = true;
}
if (fNotifyBuiltInRefs) {
fDocumentHandler.endGeneralEntity(entity, null);
}
}
}
示例3: handleCharacter
import com.sun.org.apache.xerces.internal.util.XMLStringBuffer; //导入方法依赖的package包/类
/**
* Calls document handler with a single character resulting from
* built-in entity resolution.
*
* @param c
* @param entity built-in name
* @param XMLStringBuffer append the character to buffer
*
* we really dont need to call this function -- this function is only required when
* we integrate with rest of Xerces2. SO maintaining the current behavior and still
* calling this function to hanlde built-in entity reference.
*
*/
private void handleCharacter(char c, String entity, XMLStringBuffer content) throws XNIException {
foundBuiltInRefs = true;
content.append(c);
if (fDocumentHandler != null) {
fSingleChar[0] = c;
if (fNotifyBuiltInRefs) {
fDocumentHandler.startGeneralEntity(entity, null, null, null);
}
fTempString.setValues(fSingleChar, 0, 1);
if(!fIsCoalesce){
fDocumentHandler.characters(fTempString, null);
builtInRefCharacterHandled = true;
}
if (fNotifyBuiltInRefs) {
fDocumentHandler.endGeneralEntity(entity, null);
}
}
}
示例4: handleCharacter
import com.sun.org.apache.xerces.internal.util.XMLStringBuffer; //导入方法依赖的package包/类
/**
* Calls document handler with a single character resulting from
* built-in entity resolution.
*
* @param c
* @param entity built-in name
* @param XMLStringBuffer append the character to buffer
*
* we really dont need to call this function -- this function is only required when
* we integrate with rest of Xerces2. SO maintaining the current behavior and still
* calling this function to hanlde built-in entity reference.
*
*/
private void handleCharacter(char c, String entity, XMLStringBuffer content) throws XNIException {
foundBuiltInRefs = true;
checkEntityLimit(false, fEntityScanner.fCurrentEntity.name, 1);
content.append(c);
if (fDocumentHandler != null) {
fSingleChar[0] = c;
if (fNotifyBuiltInRefs) {
fDocumentHandler.startGeneralEntity(entity, null, null, null);
}
fTempString.setValues(fSingleChar, 0, 1);
//fDocumentHandler.characters(fTempString, null);
if (fNotifyBuiltInRefs) {
fDocumentHandler.endGeneralEntity(entity, null);
}
}
}
示例5: scanSurrogates
import com.sun.org.apache.xerces.internal.util.XMLStringBuffer; //导入方法依赖的package包/类
/**
* Scans surrogates and append them to the specified buffer.
* <p>
* <strong>Note:</strong> This assumes the current char has already been
* identified as a high surrogate.
*
* @param buf The StringBuffer to append the read surrogates to.
* @return True if it succeeded.
*/
protected boolean scanSurrogates(XMLStringBuffer buf)
throws IOException, XNIException {
int high = fEntityScanner.scanChar();
int low = fEntityScanner.peekChar();
if (!XMLChar.isLowSurrogate(low)) {
reportFatalError("InvalidCharInContent",
new Object[] {Integer.toString(high, 16)});
return false;
}
fEntityScanner.scanChar();
// convert surrogates to supplemental character
int c = XMLChar.supplemental((char)high, (char)low);
// supplemental character must be a valid XML character
if (isInvalid(c)) {
reportFatalError("InvalidCharInContent",
new Object[]{Integer.toString(c, 16)});
return false;
}
// fill in the buffer
buf.append((char)high);
buf.append((char)low);
return true;
}
示例6: resolveCharacter
import com.sun.org.apache.xerces.internal.util.XMLStringBuffer; //导入方法依赖的package包/类
/**
* Resolves character entity references.
* @param entityName the name of the entity
* @param stringBuffer the current XMLStringBuffer to append the character to.
* @return true if resolved, false otherwise
*/
protected boolean resolveCharacter(String entityName, XMLStringBuffer stringBuffer) {
/**
* entityNames (symbols) are interned. The equals method would do the same,
* but I'm leaving it as comparisons by references are common in the impl
* and it made it explicit to others who read this code.
*/
if (entityName == fAmpSymbol) {
stringBuffer.append('&');
return true;
} else if (entityName == fAposSymbol) {
stringBuffer.append('\'');
return true;
} else if (entityName == fLtSymbol) {
stringBuffer.append('<');
return true;
} else if (entityName == fGtSymbol) {
checkEntityLimit(false, fEntityScanner.fCurrentEntity.name, 1);
stringBuffer.append('>');
return true;
} else if (entityName == fQuotSymbol) {
checkEntityLimit(false, fEntityScanner.fCurrentEntity.name, 1);
stringBuffer.append('"');
return true;
}
return false;
}
示例7: scanSurrogates
import com.sun.org.apache.xerces.internal.util.XMLStringBuffer; //导入方法依赖的package包/类
/**
* Scans surrogates and append them to the specified buffer.
* <p>
* <strong>Note:</strong> This assumes the current char has already been
* identified as a high surrogate.
*
* @param buf The StringBuffer to append the read surrogates to.
* @return True if it succeeded.
*/
protected boolean scanSurrogates(XMLStringBuffer buf)
throws IOException, XNIException {
int high = fEntityScanner.scanChar(null);
int low = fEntityScanner.peekChar();
if (!XMLChar.isLowSurrogate(low)) {
reportFatalError("InvalidCharInContent",
new Object[] {Integer.toString(high, 16)});
return false;
}
fEntityScanner.scanChar(null);
// convert surrogates to supplemental character
int c = XMLChar.supplemental((char)high, (char)low);
// supplemental character must be a valid XML character
if (isInvalid(c)) {
reportFatalError("InvalidCharInContent",
new Object[]{Integer.toString(c, 16)});
return false;
}
// fill in the buffer
buf.append((char)high);
buf.append((char)low);
return true;
}
示例8: scanContent
import com.sun.org.apache.xerces.internal.util.XMLStringBuffer; //导入方法依赖的package包/类
/**
* Scans element content.
*
* @return Returns the next character on the stream.
*/
//CHANGED:
//EARLIER: scanContent()
//NOW: scanContent(XMLStringBuffer)
//It makes things easy if this functions takes XMLStringBuffer as parameter..
//this function appends the data to the buffer.
protected int scanContent(XMLStringBuffer content) throws IOException, XNIException {
//set the fTempString length to 0 before passing it on to scanContent
//scanContent sets the correct co-ordinates as per the content read
fTempString.length = 0;
int c = fEntityScanner.scanContent(fTempString);
content.append(fTempString);
fTempString.length = 0;
if (c == '\r') {
// happens when there is the character reference
//xxx: We know the next chracter.. we should just skip it and add ']' directlry
fEntityScanner.scanChar();
content.append((char)c);
c = -1;
} else if (c == ']') {
//fStringBuffer.clear();
//xxx: We know the next chracter.. we should just skip it and add ']' directlry
content.append((char)fEntityScanner.scanChar());
// remember where we are in case we get an endEntity before we
// could flush the buffer out - this happens when we're parsing an
// entity which ends with a ]
fInScanContent = true;
//
// We work on a single character basis to handle cases such as:
// ']]]>' which we might otherwise miss.
//
if (fEntityScanner.skipChar(']')) {
content.append(']');
while (fEntityScanner.skipChar(']')) {
content.append(']');
}
if (fEntityScanner.skipChar('>')) {
reportFatalError("CDEndInContent", null);
}
}
fInScanContent = false;
c = -1;
}
if (fDocumentHandler != null && content.length > 0) {
//fDocumentHandler.characters(content, null);
}
return c;
}
示例9: scanContent
import com.sun.org.apache.xerces.internal.util.XMLStringBuffer; //导入方法依赖的package包/类
/**
* Scans element content.
*
* @return Returns the next character on the stream.
*/
protected int scanContent(XMLStringBuffer content) throws IOException, XNIException {
fTempString.length = 0;
int c = fEntityScanner.scanContent(fTempString);
content.append(fTempString);
if (c == '\r' || c == 0x85 || c == 0x2028) {
// happens when there is the character reference
// but scanContent doesn't do entity expansions...
// is this *really* necessary??? - NG
fEntityScanner.scanChar();
content.append((char)c);
c = -1;
}
/*if (fDocumentHandler != null && content.length > 0) {
fDocumentHandler.characters(content, null);
} */
if (c == ']') {
content.append((char)fEntityScanner.scanChar());
// remember where we are in case we get an endEntity before we
// could flush the buffer out - this happens when we're parsing an
// entity which ends with a ]
fInScanContent = true;
//
// We work on a single character basis to handle cases such as:
// ']]]>' which we might otherwise miss.
//
if (fEntityScanner.skipChar(']')) {
content.append(']');
while (fEntityScanner.skipChar(']')) {
content.append(']');
}
if (fEntityScanner.skipChar('>')) {
reportFatalError("CDEndInContent", null);
}
}
/*if (fDocumentHandler != null && fStringBuffer.length != 0) {
fDocumentHandler.characters(fStringBuffer, null);
}*/
fInScanContent = false;
c = -1;
}
return c;
}
示例10: scanContent
import com.sun.org.apache.xerces.internal.util.XMLStringBuffer; //导入方法依赖的package包/类
/**
* Scans element content.
*
* @return Returns the next character on the stream.
*/
//CHANGED:
//EARLIER: scanContent()
//NOW: scanContent(XMLStringBuffer)
//It makes things easy if this functions takes XMLStringBuffer as parameter..
//this function appends the data to the buffer.
protected int scanContent(XMLStringBuffer content) throws IOException, XNIException {
//set the fTempString length to 0 before passing it on to scanContent
//scanContent sets the correct co-ordinates as per the content read
fTempString.length = 0;
int c = fEntityScanner.scanContent(fTempString);
content.append(fTempString);
fTempString.length = 0;
if (c == '\r') {
// happens when there is the character reference
//xxx: We know the next chracter.. we should just skip it and add ']' directlry
fEntityScanner.scanChar(null);
content.append((char)c);
c = -1;
} else if (c == ']') {
//fStringBuffer.clear();
//xxx: We know the next chracter.. we should just skip it and add ']' directlry
content.append((char)fEntityScanner.scanChar(null));
// remember where we are in case we get an endEntity before we
// could flush the buffer out - this happens when we're parsing an
// entity which ends with a ]
fInScanContent = true;
//
// We work on a single character basis to handle cases such as:
// ']]]>' which we might otherwise miss.
//
if (fEntityScanner.skipChar(']', null)) {
content.append(']');
while (fEntityScanner.skipChar(']', null)) {
content.append(']');
}
if (fEntityScanner.skipChar('>', null)) {
reportFatalError("CDEndInContent", null);
}
}
fInScanContent = false;
c = -1;
}
if (fDocumentHandler != null && content.length > 0) {
//fDocumentHandler.characters(content, null);
}
return c;
}
示例11: scanContent
import com.sun.org.apache.xerces.internal.util.XMLStringBuffer; //导入方法依赖的package包/类
/**
* Scans element content.
*
* @return Returns the next character on the stream.
*/
protected int scanContent(XMLStringBuffer content) throws IOException, XNIException {
fTempString.length = 0;
int c = fEntityScanner.scanContent(fTempString);
content.append(fTempString);
if (c == '\r' || c == 0x85 || c == 0x2028) {
// happens when there is the character reference
// but scanContent doesn't do entity expansions...
// is this *really* necessary??? - NG
fEntityScanner.scanChar(null);
content.append((char)c);
c = -1;
}
/*if (fDocumentHandler != null && content.length > 0) {
fDocumentHandler.characters(content, null);
} */
if (c == ']') {
content.append((char)fEntityScanner.scanChar(null));
// remember where we are in case we get an endEntity before we
// could flush the buffer out - this happens when we're parsing an
// entity which ends with a ]
fInScanContent = true;
//
// We work on a single character basis to handle cases such as:
// ']]]>' which we might otherwise miss.
//
if (fEntityScanner.skipChar(']', null)) {
content.append(']');
while (fEntityScanner.skipChar(']', null)) {
content.append(']');
}
if (fEntityScanner.skipChar('>', null)) {
reportFatalError("CDEndInContent", null);
}
}
/*if (fDocumentHandler != null && fStringBuffer.length != 0) {
fDocumentHandler.characters(fStringBuffer, null);
}*/
fInScanContent = false;
c = -1;
}
return c;
}