You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yoko-commits@incubator.apache.org by br...@apache.org on 2007/05/25 16:41:04 UTC
svn commit: r541720 -
/incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/types/CorbaOctetSequenceEventProducer.java
Author: bravi
Date: Fri May 25 09:41:01 2007
New Revision: 541720
URL: http://svn.apache.org/viewvc?view=rev&rev=541720
Log:
[YOKO-366] - missed a file in my earlier commit.
Added:
incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/types/CorbaOctetSequenceEventProducer.java (with props)
Added: incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/types/CorbaOctetSequenceEventProducer.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/types/CorbaOctetSequenceEventProducer.java?view=auto&rev=541720
==============================================================================
--- incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/types/CorbaOctetSequenceEventProducer.java (added)
+++ incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/types/CorbaOctetSequenceEventProducer.java Fri May 25 09:41:01 2007
@@ -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.yoko.bindings.corba.types;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.events.Attribute;
+import javax.xml.stream.events.Namespace;
+
+public class CorbaOctetSequenceEventProducer implements CorbaTypeEventProducer {
+
+ int state;
+ final int[] states = {XMLStreamReader.START_ELEMENT,
+ XMLStreamReader.CHARACTERS,
+ XMLStreamReader.END_ELEMENT};
+ final CorbaSequenceHandler seqHandler;
+ final QName name;
+
+ public CorbaOctetSequenceEventProducer(CorbaObjectHandler h) {
+ seqHandler = (CorbaSequenceHandler) h;
+ name = seqHandler.getName();
+ }
+
+ public String getLocalName() {
+ return seqHandler.getSimpleName();
+ }
+
+ public QName getName() {
+ return name;
+ }
+
+ public String getText() {
+ List<CorbaObjectHandler> elements = seqHandler.getElements();
+ byte[] value = new byte[elements.size()];
+ for (int i = 0; i < elements.size(); i++) {
+ CorbaPrimitiveHandler handler = (CorbaPrimitiveHandler) elements.get(i);
+ value[i] = ((Byte) handler.getValue()).byteValue();
+ }
+ return new String(value);
+ }
+
+ public int next() {
+ return states[state++];
+ }
+
+ public boolean hasNext() {
+ return state < states.length;
+ }
+
+ public List<Attribute> getAttributes() {
+ return null;
+ }
+
+ public List<Namespace> getNamespaces() {
+ return null;
+ }
+}
Propchange: incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/types/CorbaOctetSequenceEventProducer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/branches/perf/src/main/java/org/apache/yoko/bindings/corba/types/CorbaOctetSequenceEventProducer.java
------------------------------------------------------------------------------
svn:keywords = Rev Date