XSLT in Practice. Exercises  download Apache Xalan - install it - try the example in Xalan-Java Overview  ZVON XSLT Tutorial.

Slides:



Advertisements
Similar presentations
A Guide to Advanced Java Faculty:Nguyen Ngoc Tu. 2 Operating System Application #1 Application #2 Java Virtual Machine #1 Local Memory Shared Memory Threads.
Advertisements

Streams Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 Serialization Flatten your object for automated storage or network.
Slide 10.1 Advanced Programming 2004, based on LY Stefanus’s Slides Object Serialization Object serialization: the process of converting an object into.
Chapter - 12 File and Streams (continued) This chapter includes -  DataOutputStream  DataInputStream  Object Serialization  Serializing Objects 
Lecture 31 File I/O -Part 2 COMP1681 / SE15 Introduction to Programming.
Head-First Design Patterns. Similar to a ReminderEntry.
Java Beans & Serialization CS-328 Dick Steflik. Java Beans Java based component technology –originally developed to provide java with a component technology.
Chapter 91 Streams and File I/O Chapter 9. 2 Announcements Project 5 due last night Project 6 assigned Exam 2 –Wed., March 21, 7:00 – 8:00 pm, LILY 1105.
File-based Persistence: Serializability COMP53 Dec 7, 2007.
Java Iterators interface Collection { … Iterator iterator(); Iterator iterator(); …} interface Set extends Collection { … Iterator iterator(); Iterator.
Scott Grissom, copyright 2004Ch 3: Java Features Slide 1 Why Java? It is object-oriented provides many ready to use classes platform independent modern.
Advanced Java Class Serialization. Serialization – what and why? What? –Translating the contents of an Object to a series of bytes that represent it,
Java Review 2. The Agenda The following topics were highlighted to me as issues: –File IO (Rem) –Wrappers (Rem) –Interfaces (Rem) –Asymptotic Notation.
Xpath Sources:
Files and Streams 1 -Based on slides from Deitel & Associates, Inc. - Revised by T. A. Yang.
Working with files By the end of this lecture you should be able to: explain the principles of input and output and identify a number of different input.
Lecture Objectives  To learn how to use a tree to represent a hierarchical organization of information  To learn how to use recursion to process trees.
1 TCSS 360, Spring 2005 Lecture Notes Design Patterns: Singleton, Memento, Flyweight.
Streams Reading: 2 nd Ed: , rd Ed: 11.1, 19.1, 19.4
Java I/O Writing and Reading Objects to File Serialization.
Working with files. RHS – SOC 2 Motivation All our programs so far have only worked with data stored in primary storage (RAM) Data is lost when program.
Serialization. Serialization is the process of converting an object into an intermediate format that can be stored (e.g. in a file or transmitted across.
Object Persistence and Object serialization CSNB534 Asma Shakil.
L5: Input & Output COMP206, Geoff Holmes and Bernhard Pfahringer.
CS378 - Mobile Computing Persistence. Saving State We have already seen saving app state into a Bundle on orientation changes or when an app is killed.
Serialization CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
©SoftMoore ConsultingSlide 1 Serialization. ©SoftMoore ConsultingSlide 2 Serialization Allows objects to be written to a stream Can be used for persistence.
Chapter 6 Lists Modified. Chapter Scope Types of lists Using lists to solve problems Various list implementations Comparing list implementations 6 - 2Java.
CS 116 OBJECT ORIENTED PROGRAMMING II LECTURE 12 GEORGE KOUTSOGIANNAKIS Copyright: 2015 Illinois Institute of Technology/ George Koutsogiannakis 1.
Introduction to Collections. Collections Collections provide a way of organizing related data in a model Different types of collections have different.
Spring 2008 Mark Fontenot CSE Honors Principles of Computer Science I Note Set 20.
J2EE/Java EE Apache Tomcat v9 IBM Websphere v8 Redhat JBoss EAP v6 Oracle Weblogic v12 Fusion Web Tier ServletsJSPJSF Business Tier JMXJMSEJB.
Files and Serialization. Files Used to transfer data to and from secondary storage.
CSE 1020: Exceptions and A multiclass application Mark Shtern 1-1.
Simple Java I/O Part I General Principles. Streams All modern I/O is stream-based A stream is a connection to a source of data or to a destination for.
Graphical User Interfaces [notes Chap 7] and [AJ Chap 17, Sec 13.2] 1.
1 CSE 331 Memento Pattern and Serialization slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer, Wikipedia
Streams. RHS – SWC 2 Binary files A binary file contains ”raw” bytes that can be interpreted as almost anything Can have any extension Can be created.
Iterators. Chapter Scope The purpose of an iterator The Iterator and Interable interfaces The concept of fail-fast collections Using iterators to solve.
OBJECT ORIENTED PROGRAMMING II LECTURE 21 GEORGE KOUTSOGIANNAKIS
Using Streams, Files, Serialization
Networking Serialization
Object Writing in files
Object Serialization in Java
Hands on XSL XSL-basic elements.
Memento Design Pattern
Chapter 16 Iterators.
Accessing Files in Java
Java Serialization B.Ramamurthy 11/8/2018 B.Ramamurthy.
Client server programming
Programming in Java Files and I/O Streams
CS 116 Object Oriented Programming II
Chapter 7 Iterators.
Java Serialization B.Ramamurthy 11/14/2018 B.Ramamurthy.
Working with files.
Persistence & Bean Properties
null, true, and false are also reserved.
CS 190 Lecture Notes: Tweeter Project
Object Serialization Explanation + Example of file + network
Exceptions Complicate Code
Exceptions Complicate Code
Computer Science and Engineering
Command Invocation Protocol
CSE 331 Memento Pattern slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer, Wikipedia
OBJECT ORIENTED PROGRAMMING II LECTURE 22 GEORGE KOUTSOGIANNAKIS
Exceptions Complicate Code
Podcast Ch23f Title: Serialization
The command invocation protocol
Presentation transcript:

XSLT in Practice

Exercises  download Apache Xalan - install it - try the example in Xalan-Java Overview  ZVON XSLT Tutorial  ZVON Interactive Lab

XML Serialization

import java.io.File; import org.simpleframework.xml.Serializer; import org.simpleframework.xml.load.Persister; public class StorableAsXML implements Serializable { // ==== SERIALIZATION/DESERIALIZATION PRIMITIVES public void persist(File f){ Serializer serializer = new Persister(); try { serializer.write(this, f); } catch (Exception ex) { ex.printStackTrace(); } Using XML to serialize Java Classes // using Simple XML Serialization // import java.io.Serializable; public class X implements Serializable FileOutputStream fos=null; ObjectOutputStream oos=null; try { fos=new FileOutputStream(f); oos = new ObjectOutputStream(fos); oos.writeObject(this); } catch (IOException ex) { ex.printStackTrace(); }

public StorableAsXML resume(File f, Class c){ StorableAsXML retval = null; try { Serializer serializer = new Persister(); retval = (StorableAsXML)serializer.read(c, f); } catch (Exception ex) { ex.printStackTrace(); } return retval; } Using XML to serialize Java Classes FileInputStream fis=null; ObjectInputStream ois=null; try { fis=new FileInputStream(f); ois = new ObjectInputStream(fis); retval=(StorableAsXML)ois.readObject(); } catch (Exception ex) { ex.printStackTrace(); }

public class Lecture extends StorableAsXML implements Serializable { private Set lecturers=null; //non serialized public String private Date private int sequenceNumber=-1; //-1 means not private String courseRef=null; //Home per il private String private String private String private String videoLenght=null; //null = Video does not private boolean hasPostProcessing=false; Using XML to serialize Java Classes public Lecture(){ // needed to be a bean //for XMLSerialization …; }

Generated XML gg :20: CEST 1 /Users/ronchet/_LODE/COURSES/Hh_ _Gg_ A.B. false

@Root(name="COURSE") public class Course extends StorableAsXML implements Serializable private String private String private String private Set lectures=new TreeSet private Set teachers=new TreeSet (); Using XML to serialize Java Classes hh 2008 /Hh_ _Gg_ A.B. C.D.

Javadoc /doc/javadoc/org/simpleframework/xml/packa ge-summary.html