Package gnu.kawa.xslt
Class XslTranslator
- java.lang.Object
-
- java.io.Reader
-
- gnu.text.Lexer
-
- gnu.kawa.xslt.XslTranslator
-
- All Implemented Interfaces:
Consumer,java.io.Closeable,java.lang.Appendable,java.lang.AutoCloseable,java.lang.Readable,java.util.function.Consumer<java.lang.Object>,java.util.function.DoubleConsumer,java.util.function.IntConsumer,java.util.function.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 Consumerappend(char v)Consumerappend(java.lang.CharSequence csq)Consumerappend(java.lang.CharSequence csq, int start, int end)voidendAttribute()End of an attribute or end of an actual parameter.voidendDocument()voidendElement()voiderror(char kind, java.lang.String message)ExpressiongetExpression()booleanignoring()True if consumer is ignoring rest of element.static java.lang.StringisXslTag(java.lang.Object type)voidparse(Compilation comp)java.lang.StringpopMatchingAttribute(java.lang.String ns, java.lang.String name, int start)voidstartAttribute(java.lang.Object attrType)Write a attribute for the current element.voidstartDocument()voidstartDocument(ModuleExp mexp)voidstartElement(java.lang.Object type)voidwrite(char[] buf, int off, int len)voidwrite(int v)voidwrite(java.lang.CharSequence str, int start, int length)voidwrite(java.lang.String str)voidwriteBoolean(boolean v)voidwriteDouble(double v)voidwriteFloat(float v)voidwriteInt(int v)voidwriteLong(long v)voidwriteObject(java.lang.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
-
-
-
-
Method Detail
-
popMatchingAttribute
public java.lang.String popMatchingAttribute(java.lang.String ns, java.lang.String name, int start)
-
isXslTag
public static java.lang.String isXslTag(java.lang.Object type)
-
startElement
public void startElement(java.lang.Object type)
- Specified by:
startElementin interfaceConsumer
-
startAttribute
public void startAttribute(java.lang.Object attrType)
Description copied from interface:ConsumerWrite a attribute for the current element. This is only allowed immediately after a startElement.- Specified by:
startAttributein interfaceConsumer
-
endAttribute
public void endAttribute()
Description copied from interface:ConsumerEnd 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:
endAttributein interfaceConsumer
-
endElement
public void endElement()
- Specified by:
endElementin interfaceConsumer
-
append
public Consumer append(char v)
-
append
public Consumer append(java.lang.CharSequence csq)
-
append
public Consumer append(java.lang.CharSequence csq, int start, int end)
-
writeBoolean
public void writeBoolean(boolean v)
- Specified by:
writeBooleanin interfaceConsumer
-
writeFloat
public void writeFloat(float v)
- Specified by:
writeFloatin interfaceConsumer
-
writeDouble
public void writeDouble(double v)
- Specified by:
writeDoublein interfaceConsumer
-
startDocument
public void startDocument()
- Specified by:
startDocumentin interfaceConsumer
-
startDocument
public void startDocument(ModuleExp mexp)
-
endDocument
public void endDocument()
- Specified by:
endDocumentin interfaceConsumer
-
writeObject
public void writeObject(java.lang.Object v)
- Specified by:
writeObjectin interfaceConsumer
-
write
public void write(java.lang.CharSequence str, int start, int length)
-
ignoring
public boolean ignoring()
Description copied from interface:ConsumerTrue 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 java.io.IOException
- Throws:
java.io.IOException
-
-