Package gnu.kawa.xslt
Class XslTranslator
- java.lang.Object
-
- java.io.Reader
-
- gnu.text.Lexer
-
- gnu.kawa.xslt.XslTranslator
-
- All Implemented Interfaces:
Consumer
,Closeable
,Appendable
,AutoCloseable
,Readable
,Consumer<Object>
,DoubleConsumer
,IntConsumer
,LongConsumer
public class XslTranslator extends Lexer implements Consumer
Translate an XSLT stylesheet to a Kawa Expression tree.
-
-
Field Summary
-
Fields inherited from class gnu.text.Lexer
port, tentative, tokenBuffer, tokenBufferLength
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Consumer
append(char v)
Consumer
append(CharSequence csq)
Consumer
append(CharSequence csq, int start, int end)
void
endAttribute()
End of an attribute or end of an actual parameter.void
endDocument()
void
endElement()
void
error(char kind, String message)
Expression
getExpression()
boolean
ignoring()
True if consumer is ignoring rest of element.static String
isXslTag(Object type)
void
parse(Compilation comp)
String
popMatchingAttribute(String ns, String name, int start)
void
startAttribute(Object attrType)
Write a attribute for the current element.void
startDocument()
void
startDocument(ModuleExp mexp)
void
startElement(Object type)
void
write(char[] buf, int off, int len)
void
write(int v)
void
write(CharSequence str, int start, int length)
void
write(String str)
void
writeBoolean(boolean v)
void
writeDouble(double v)
void
writeFloat(float v)
void
writeInt(int v)
void
writeLong(long v)
void
writeObject(Object v)
-
Methods inherited from class gnu.text.Lexer
checkErrors, checkNext, clearErrors, close, eofError, eofError, error, error, fatal, getColumnNumber, getErrors, getLineNumber, getMessages, getName, getPort, isInteractive, isTentative, mark, peek, popNesting, pushNesting, read, read, readCodePoint, readDelimited, readDigits, readDigitsInBuffer, readIntDigits, readOptionalExponent, readUnicodeChar, reset, seenErrors, setInteractive, setMessages, setTentative, skip, skip_quick, tokenBufferAppend, tokenBufferString, unread, unread, unread_quick
-
Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, ready, skip, transferTo
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.function.DoubleConsumer
andThen
-
Methods inherited from interface java.util.function.IntConsumer
andThen
-
Methods inherited from interface java.util.function.LongConsumer
andThen
-
-
-
-
Method Detail
-
startElement
public void startElement(Object type)
- Specified by:
startElement
in interfaceConsumer
-
startAttribute
public void startAttribute(Object attrType)
Description copied from interface:Consumer
Write a attribute for the current element. This is only allowed immediately after a startElement.- Specified by:
startAttribute
in interfaceConsumer
-
endAttribute
public void endAttribute()
Description copied from interface:Consumer
End of an attribute or end of an actual parameter. The former use matches a startAttribute; the latter may not, and can be used to separate parameters in a parameter list. This double duty suggsts the method should at least be re-named.- Specified by:
endAttribute
in interfaceConsumer
-
endElement
public void endElement()
- Specified by:
endElement
in interfaceConsumer
-
append
public Consumer append(char v)
- Specified by:
append
in interfaceAppendable
- Specified by:
append
in interfaceConsumer
-
append
public Consumer append(CharSequence csq)
- Specified by:
append
in interfaceAppendable
- Specified by:
append
in interfaceConsumer
-
append
public Consumer append(CharSequence csq, int start, int end)
- Specified by:
append
in interfaceAppendable
- Specified by:
append
in interfaceConsumer
-
writeBoolean
public void writeBoolean(boolean v)
- Specified by:
writeBoolean
in interfaceConsumer
-
writeFloat
public void writeFloat(float v)
- Specified by:
writeFloat
in interfaceConsumer
-
writeDouble
public void writeDouble(double v)
- Specified by:
writeDouble
in interfaceConsumer
-
startDocument
public void startDocument()
- Specified by:
startDocument
in interfaceConsumer
-
startDocument
public void startDocument(ModuleExp mexp)
-
endDocument
public void endDocument()
- Specified by:
endDocument
in interfaceConsumer
-
writeObject
public void writeObject(Object v)
- Specified by:
writeObject
in interfaceConsumer
-
write
public void write(CharSequence str, int start, int length)
-
ignoring
public boolean ignoring()
Description copied from interface:Consumer
True if consumer is ignoring rest of element. The producer can use this information to skip ahead.
-
getExpression
public Expression getExpression()
-
parse
public void parse(Compilation comp) throws IOException
- Throws:
IOException
-
-