You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ha...@apache.org on 2008/11/23 04:35:29 UTC
svn commit: r719946 - in
/myfaces/commons/trunk/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/exporter:
./ ExporterBean.java SimpleCar.java
Author: hazems
Date: Sat Nov 22 19:35:28 2008
New Revision: 719946
URL: http://svn.apache.org/viewvc?rev=719946&view=rev
Log:
Adding the exporter bean example.
Added:
myfaces/commons/trunk/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/exporter/
myfaces/commons/trunk/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/exporter/ExporterBean.java
myfaces/commons/trunk/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/exporter/SimpleCar.java
Added: myfaces/commons/trunk/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/exporter/ExporterBean.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/exporter/ExporterBean.java?rev=719946&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/exporter/ExporterBean.java (added)
+++ myfaces/commons/trunk/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/exporter/ExporterBean.java Sat Nov 22 19:35:28 2008
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.commons.exporter;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author cagatay (latest modification by $Author: skitching $)
+ * @version $Revision: 673833 $ $Date: 2008-07-03 23:58:05 +0200 (Thu, 03 Jul 2008) $
+ */
+public class ExporterBean implements Serializable {
+
+ private List carsList;
+
+ public List getCarsList() {
+ if( carsList == null)
+ carsList = createCarsList();
+ return carsList;
+ }
+
+ public void setCarsList(List carsList) {
+ this.carsList = carsList;
+ }
+
+ private List createCarsList() {
+ List list = new ArrayList();
+
+ for(int i = 0; i < 10; ++i) {
+ list.add( new SimpleCar(i, "row" + i, "value" + i));
+ }
+ return list;
+ }
+
+ public String export() {
+ return null;
+ }
+}
Added: myfaces/commons/trunk/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/exporter/SimpleCar.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/exporter/SimpleCar.java?rev=719946&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/exporter/SimpleCar.java (added)
+++ myfaces/commons/trunk/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/exporter/SimpleCar.java Sat Nov 22 19:35:28 2008
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.commons.exporter;
+
+import java.io.Serializable;
+
+/**
+ * DOCUMENT ME!
+ * @author Thomas Spiegl (latest modification by $Author: lu4242 $)
+ * @version $Revision: 651110 $ $Date: 2008-04-24 01:46:09 +0200 (Thu, 24 Apr 2008) $
+ */
+public class SimpleCar
+ implements Serializable
+{
+ /**
+ * serial id for serialisation versioning
+ */
+ private static final long serialVersionUID = 1L;
+ private int _id;
+ private String _type;
+ private String _color;
+
+ public SimpleCar(int id, String type, String color)
+ {
+ _id = id;
+ _type = type;
+ _color = color;
+ }
+
+ public int getId()
+ {
+ return _id;
+ }
+
+ public void setId(int id)
+ {
+ _id = id;
+ }
+
+ public String getType()
+ {
+ return _type;
+ }
+
+ public void setType(String type)
+ {
+ _type = type;
+ }
+
+ public String getColor()
+ {
+ return _color;
+ }
+
+ public void setColor(String color)
+ {
+ _color = color;
+ }
+}