下面列出了怎么用javax.swing.text.ChangedCharSetException的API类实例代码及写法,或者点击链接到github查看源代码。
void read(InputStream in, Document doc) throws IOException
{
EditorKit kit = getEditorKit();
try
{
kit.read(in, doc, 0);
} catch (ChangedCharSetException ccse)
{
// ignored, may be in the future will be processed
throw ccse;
} catch (BadLocationException ble)
{
throw new IOException(ble);
}
}
/**
* Create a legal context for a tag.
*/
void legalTagContext(TagElement tag) throws ChangedCharSetException {
if (legalElementContext(tag.getElement())) {
markFirstTime(tag.getElement());
return;
}
// Avoid putting a block tag in a flow tag.
if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
endTag(true);
legalTagContext(tag);
return;
}
// Avoid putting something wierd in the head of the document.
for (TagStack s = stack ; s != null ; s = s.next) {
if (s.tag.getElement() == dtd.head) {
while (stack != s) {
endTag(true);
}
endTag(true);
legalTagContext(tag);
return;
}
}
// Everything failed
error("tag.unexpected", tag.getElement().getName());
}
/**
* Create a legal context for a tag.
*/
void legalTagContext(TagElement tag) throws ChangedCharSetException {
if (legalElementContext(tag.getElement())) {
markFirstTime(tag.getElement());
return;
}
// Avoid putting a block tag in a flow tag.
if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
endTag(true);
legalTagContext(tag);
return;
}
// Avoid putting something wierd in the head of the document.
for (TagStack s = stack ; s != null ; s = s.next) {
if (s.tag.getElement() == dtd.head) {
while (stack != s) {
endTag(true);
}
endTag(true);
legalTagContext(tag);
return;
}
}
// Everything failed
error("tag.unexpected", tag.getElement().getName());
}
/**
* Error context. Something went wrong, make sure we are in
* the document's body context
*/
void errorContext() throws ChangedCharSetException {
for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
handleEndTag(stack.tag);
}
if (stack == null) {
legalElementContext(dtd.body);
startTag(makeTag(dtd.body, true));
}
}
/**
* Create a legal context for a tag.
*/
void legalTagContext(TagElement tag) throws ChangedCharSetException {
if (legalElementContext(tag.getElement())) {
markFirstTime(tag.getElement());
return;
}
// Avoid putting a block tag in a flow tag.
if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
endTag(true);
legalTagContext(tag);
return;
}
// Avoid putting something wierd in the head of the document.
for (TagStack s = stack ; s != null ; s = s.next) {
if (s.tag.getElement() == dtd.head) {
while (stack != s) {
endTag(true);
}
endTag(true);
legalTagContext(tag);
return;
}
}
// Everything failed
error("tag.unexpected", tag.getElement().getName());
}
/**
* Error context. Something went wrong, make sure we are in
* the document's body context
*/
void errorContext() throws ChangedCharSetException {
for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
handleEndTag(stack.tag);
}
if (stack == null) {
legalElementContext(dtd.body);
startTag(makeTag(dtd.body, true));
}
}
/**
* Create a legal context for a tag.
*/
void legalTagContext(TagElement tag) throws ChangedCharSetException {
if (legalElementContext(tag.getElement())) {
markFirstTime(tag.getElement());
return;
}
// Avoid putting a block tag in a flow tag.
if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
endTag(true);
legalTagContext(tag);
return;
}
// Avoid putting something wierd in the head of the document.
for (TagStack s = stack ; s != null ; s = s.next) {
if (s.tag.getElement() == dtd.head) {
while (stack != s) {
endTag(true);
}
endTag(true);
legalTagContext(tag);
return;
}
}
// Everything failed
error("tag.unexpected", tag.getElement().getName());
}
/**
* Error context. Something went wrong, make sure we are in
* the document's body context
*/
void errorContext() throws ChangedCharSetException {
for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
handleEndTag(stack.tag);
}
if (stack == null) {
legalElementContext(dtd.body);
startTag(makeTag(dtd.body, true));
}
}
/**
* Error context. Something went wrong, make sure we are in
* the document's body context
*/
void errorContext() throws ChangedCharSetException {
for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
handleEndTag(stack.tag);
}
if (stack == null) {
legalElementContext(dtd.body);
startTag(makeTag(dtd.body, true));
}
}
/**
* Create a legal context for a tag.
*/
void legalTagContext(TagElement tag) throws ChangedCharSetException {
if (legalElementContext(tag.getElement())) {
markFirstTime(tag.getElement());
return;
}
// Avoid putting a block tag in a flow tag.
if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
endTag(true);
legalTagContext(tag);
return;
}
// Avoid putting something wierd in the head of the document.
for (TagStack s = stack ; s != null ; s = s.next) {
if (s.tag.getElement() == dtd.head) {
while (stack != s) {
endTag(true);
}
endTag(true);
legalTagContext(tag);
return;
}
}
// Everything failed
error("tag.unexpected", tag.getElement().getName());
}
/**
* Error context. Something went wrong, make sure we are in
* the document's body context
*/
void errorContext() throws ChangedCharSetException {
for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
handleEndTag(stack.tag);
}
if (stack == null) {
legalElementContext(dtd.body);
startTag(makeTag(dtd.body, true));
}
}
/**
* Error context. Something went wrong, make sure we are in
* the document's body context
*/
void errorContext() throws ChangedCharSetException {
for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
handleEndTag(stack.tag);
}
if (stack == null) {
legalElementContext(dtd.body);
startTag(makeTag(dtd.body, true));
}
}
/**
* Create a legal context for a tag.
*/
void legalTagContext(TagElement tag) throws ChangedCharSetException {
if (legalElementContext(tag.getElement())) {
markFirstTime(tag.getElement());
return;
}
// Avoid putting a block tag in a flow tag.
if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
endTag(true);
legalTagContext(tag);
return;
}
// Avoid putting something wierd in the head of the document.
for (TagStack s = stack ; s != null ; s = s.next) {
if (s.tag.getElement() == dtd.head) {
while (stack != s) {
endTag(true);
}
endTag(true);
legalTagContext(tag);
return;
}
}
// Everything failed
error("tag.unexpected", tag.getElement().getName());
}
/**
* Create a legal context for a tag.
*/
void legalTagContext(TagElement tag) throws ChangedCharSetException {
if (legalElementContext(tag.getElement())) {
markFirstTime(tag.getElement());
return;
}
// Avoid putting a block tag in a flow tag.
if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
endTag(true);
legalTagContext(tag);
return;
}
// Avoid putting something wierd in the head of the document.
for (TagStack s = stack ; s != null ; s = s.next) {
if (s.tag.getElement() == dtd.head) {
while (stack != s) {
endTag(true);
}
endTag(true);
legalTagContext(tag);
return;
}
}
// Everything failed
error("tag.unexpected", tag.getElement().getName());
}
/**
* Error context. Something went wrong, make sure we are in
* the document's body context
*/
void errorContext() throws ChangedCharSetException {
for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
handleEndTag(stack.tag);
}
if (stack == null) {
legalElementContext(dtd.body);
startTag(makeTag(dtd.body, true));
}
}
/**
* Create a legal context for a tag.
*/
void legalTagContext(TagElement tag) throws ChangedCharSetException {
if (legalElementContext(tag.getElement())) {
markFirstTime(tag.getElement());
return;
}
// Avoid putting a block tag in a flow tag.
if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
endTag(true);
legalTagContext(tag);
return;
}
// Avoid putting something wierd in the head of the document.
for (TagStack s = stack ; s != null ; s = s.next) {
if (s.tag.getElement() == dtd.head) {
while (stack != s) {
endTag(true);
}
endTag(true);
legalTagContext(tag);
return;
}
}
// Everything failed
error("tag.unexpected", tag.getElement().getName());
}
/**
* Error context. Something went wrong, make sure we are in
* the document's body context
*/
void errorContext() throws ChangedCharSetException {
for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
handleEndTag(stack.tag);
}
if (stack == null) {
legalElementContext(dtd.body);
startTag(makeTag(dtd.body, true));
}
}
/**
* Create a legal context for a tag.
*/
void legalTagContext(TagElement tag) throws ChangedCharSetException {
if (legalElementContext(tag.getElement())) {
markFirstTime(tag.getElement());
return;
}
// Avoid putting a block tag in a flow tag.
if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
endTag(true);
legalTagContext(tag);
return;
}
// Avoid putting something wierd in the head of the document.
for (TagStack s = stack ; s != null ; s = s.next) {
if (s.tag.getElement() == dtd.head) {
while (stack != s) {
endTag(true);
}
endTag(true);
legalTagContext(tag);
return;
}
}
// Everything failed
error("tag.unexpected", tag.getElement().getName());
}
/**
* Error context. Something went wrong, make sure we are in
* the document's body context
*/
void errorContext() throws ChangedCharSetException {
for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
handleEndTag(stack.tag);
}
if (stack == null) {
legalElementContext(dtd.body);
startTag(makeTag(dtd.body, true));
}
}
/**
* Create a legal context for a tag.
*/
void legalTagContext(TagElement tag) throws ChangedCharSetException {
if (legalElementContext(tag.getElement())) {
markFirstTime(tag.getElement());
return;
}
// Avoid putting a block tag in a flow tag.
if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
endTag(true);
legalTagContext(tag);
return;
}
// Avoid putting something wierd in the head of the document.
for (TagStack s = stack ; s != null ; s = s.next) {
if (s.tag.getElement() == dtd.head) {
while (stack != s) {
endTag(true);
}
endTag(true);
legalTagContext(tag);
return;
}
}
// Everything failed
error("tag.unexpected", tag.getElement().getName());
}
/**
* Error context. Something went wrong, make sure we are in
* the document's body context
*/
void errorContext() throws ChangedCharSetException {
for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
handleEndTag(stack.tag);
}
if (stack == null) {
legalElementContext(dtd.body);
startTag(makeTag(dtd.body, true));
}
}
/**
* Error context. Something went wrong, make sure we are in
* the document's body context
*/
void errorContext() throws ChangedCharSetException {
for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
handleEndTag(stack.tag);
}
if (stack == null) {
legalElementContext(dtd.body);
startTag(makeTag(dtd.body, true));
}
}
/**
* Create a legal context for a tag.
*/
void legalTagContext(TagElement tag) throws ChangedCharSetException {
if (legalElementContext(tag.getElement())) {
markFirstTime(tag.getElement());
return;
}
// Avoid putting a block tag in a flow tag.
if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
endTag(true);
legalTagContext(tag);
return;
}
// Avoid putting something wierd in the head of the document.
for (TagStack s = stack ; s != null ; s = s.next) {
if (s.tag.getElement() == dtd.head) {
while (stack != s) {
endTag(true);
}
endTag(true);
legalTagContext(tag);
return;
}
}
// Everything failed
error("tag.unexpected", tag.getElement().getName());
}
/**
* Error context. Something went wrong, make sure we are in
* the document's body context
*/
void errorContext() throws ChangedCharSetException {
for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
handleEndTag(stack.tag);
}
if (stack == null) {
legalElementContext(dtd.body);
startTag(makeTag(dtd.body, true));
}
}
/**
* Create a legal context for a tag.
*/
void legalTagContext(TagElement tag) throws ChangedCharSetException {
if (legalElementContext(tag.getElement())) {
markFirstTime(tag.getElement());
return;
}
// Avoid putting a block tag in a flow tag.
if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
endTag(true);
legalTagContext(tag);
return;
}
// Avoid putting something wierd in the head of the document.
for (TagStack s = stack ; s != null ; s = s.next) {
if (s.tag.getElement() == dtd.head) {
while (stack != s) {
endTag(true);
}
endTag(true);
legalTagContext(tag);
return;
}
}
// Everything failed
error("tag.unexpected", tag.getElement().getName());
}
/**
* Error context. Something went wrong, make sure we are in
* the document's body context
*/
void errorContext() throws ChangedCharSetException {
for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
handleEndTag(stack.tag);
}
if (stack == null) {
legalElementContext(dtd.body);
startTag(makeTag(dtd.body, true));
}
}
/**
* Create a legal context for a tag.
*/
void legalTagContext(TagElement tag) throws ChangedCharSetException {
if (legalElementContext(tag.getElement())) {
markFirstTime(tag.getElement());
return;
}
// Avoid putting a block tag in a flow tag.
if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
endTag(true);
legalTagContext(tag);
return;
}
// Avoid putting something wierd in the head of the document.
for (TagStack s = stack ; s != null ; s = s.next) {
if (s.tag.getElement() == dtd.head) {
while (stack != s) {
endTag(true);
}
endTag(true);
legalTagContext(tag);
return;
}
}
// Everything failed
error("tag.unexpected", tag.getElement().getName());
}
/**
* Error context. Something went wrong, make sure we are in
* the document's body context
*/
void errorContext() throws ChangedCharSetException {
for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
handleEndTag(stack.tag);
}
if (stack == null) {
legalElementContext(dtd.body);
startTag(makeTag(dtd.body, true));
}
}
/**
* Create a legal context for a tag.
*/
void legalTagContext(TagElement tag) throws ChangedCharSetException {
if (legalElementContext(tag.getElement())) {
markFirstTime(tag.getElement());
return;
}
// Avoid putting a block tag in a flow tag.
if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
endTag(true);
legalTagContext(tag);
return;
}
// Avoid putting something wierd in the head of the document.
for (TagStack s = stack ; s != null ; s = s.next) {
if (s.tag.getElement() == dtd.head) {
while (stack != s) {
endTag(true);
}
endTag(true);
legalTagContext(tag);
return;
}
}
// Everything failed
error("tag.unexpected", tag.getElement().getName());
}
/**
* Create a legal context for a tag.
*/
void legalTagContext(TagElement tag) throws ChangedCharSetException {
if (legalElementContext(tag.getElement())) {
markFirstTime(tag.getElement());
return;
}
// Avoid putting a block tag in a flow tag.
if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
endTag(true);
legalTagContext(tag);
return;
}
// Avoid putting something wierd in the head of the document.
for (TagStack s = stack ; s != null ; s = s.next) {
if (s.tag.getElement() == dtd.head) {
while (stack != s) {
endTag(true);
}
endTag(true);
legalTagContext(tag);
return;
}
}
// Everything failed
error("tag.unexpected", tag.getElement().getName());
}