User: jung
Date: 01/01/03 02:24:00
Modified: src/org/zoap/xml/meta/builtin AssociatedClassAttribute.java
BooleanElement.java ByteElement.java
CharacterElement.java CharacterType.java
ClassElement.java ClassType.java
CollectionElement.java CollectionType.java
DateElement.java DateType.java DecimalElement.java
DefaultBinding.java DoubleElement.java
FieldAttribute.java FieldElement.java
FieldNameAttribute.java FloatElement.java
IntegerElement.java LongElement.java
NameAttribute.java RefAttribute.java
ShortElement.java StringElement.java
ZoapSchema.java
Log:
exception redesign. Improved null-pointer treatment. coherent environment and
logging facilities.
Revision Changes Path
1.3 +82 -93 zoap/src/org/zoap/xml/meta/builtin/AssociatedClassAttribute.java
Index: AssociatedClassAttribute.java
===================================================================
RCS file:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/AssociatedClassAttribute.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AssociatedClassAttribute.java 2000/12/04 12:36:35 1.2
+++ AssociatedClassAttribute.java 2001/01/03 10:23:55 1.3
@@ -1,45 +1,22 @@
-/*
- * $Id: AssociatedClassAttribute.java,v 1.2 2000/12/04 12:36:35 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * $Source:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/AssociatedClassAttribute.java,v
$
+ * The Zero-effort Object Access Package is a library to support XML/SOAP
serialisation and invocation.
+ * Copyright (c) 2000 infor business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.zoap.xml.meta.builtin;
@@ -55,60 +32,72 @@
import java.util.Properties;
import java.util.Map;
-
/**
- * Meta-Meta Attribute zoap:associatedClass that should set the associated class of
a particular
- * type
+ * Meta-Attribute zoap:associatedClass that should set the associated class of a
particular
+ * type or a particular field element/attribute by resolving the package name in
the current classloader context.
+ * @author jung
+ * @version $Revision: 1.3 $
*/
public class AssociatedClassAttribute extends Attribute {
+
+ /** thats how its spelled */
+ public final static String ATTRIBUTE_NAME = "associatedClass";
- private AssociatedClassAttribute() {
- setAppearanceName("associatedClass");
- setType(StringType.getStringType());
- setAppearanceSchema(ZoapSchema.getZoapSchema());
- }
-
- // no output for now
- public Object getAttributeContent(Object object, boolean isNew, Properties
references) {
- return null;
- }
-
- public Object setAttributeContent(Object target, Object value, Map references,
Map nameSpaces)
- throws AttributeException {
-
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+".setAttributeContent("+target+","+value+","+
- references+","+nameSpaces+")");
-
- if(target instanceof FieldElement) {
- try{
- ((FieldElement) target).setAssociatedClass(Class.forName((String)
value,true,Thread.currentThread().getContextClassLoader()));
- } catch(ClassNotFoundException e) {
- throw new AttributeException();
- }
- } else if(target instanceof FieldAttribute) {
- try{
- ((FieldAttribute) target).setAssociatedClass(Class.forName((String)
value,true,Thread.currentThread().getContextClassLoader()));
- } catch(ClassNotFoundException e) {
- throw new AttributeException();
- }
- } else if(target instanceof Type) {
- try{
- ((Type) target).setAssociatedClass(Class.forName((String)
value,true,Thread.currentThread().getContextClassLoader()));
- } catch(ClassNotFoundException e) {
- throw new AttributeException();
- }
- }
-
- return target;
- }
-
- private static AssociatedClassAttribute associatedClassAttribute=
- new AssociatedClassAttribute();
-
- public static AssociatedClassAttribute getAssociatedClassAttribute() {
- return associatedClassAttribute;
- }
+ /** its a singleton hence has a private constructor */
+ private AssociatedClassAttribute() {
+ setAppearanceName(ATTRIBUTE_NAME);
+ setType(StringType.getStringType());
+ setAppearanceSchema(ZoapSchema.getZoapSchema());
+ }
+
+ /** sets the associated class on the meta-level */
+ public Object setAttributeContent(Object target, Object value, Map references,
Map nameSpaces)
+ throws AttributeException {
+
+ // big try around reflection stuff
+ if (target instanceof FieldElement) {
+ try {
+
((FieldElement)target).setAssociatedClass(Class.forName((String)value, true,
+ Thread.currentThread().getContextClassLoader()));
+ } catch (Throwable t) {
+ throw new AttributeException(toString() +
".setAttributeContent(" + target + "," + value + "," + references + "," +
+ nameSpaces + "): encountered " + t.toString() +
+ " while trying to set associated class in target field
element.", t);
+ }
+ } else if (target instanceof FieldAttribute) {
+ try {
+
((FieldAttribute)target).setAssociatedClass(Class.forName((String)value, true,
Thread.currentThread().getContextClassLoader()));
+ } catch (Throwable t) {
+ throw new AttributeException(toString() +
".setAttributeContent(" + target + "," + value + "," + references + "," +
+ nameSpaces + "): encountered " + t.toString() +
+ " while trying to set associated class in target field
attribute.", t);
+ }
+ } else if (target instanceof Type) {
+ try {
+
((Type)target).setAssociatedClass(Class.forName((String)value,
+ true, Thread.currentThread().getContextClassLoader()));
+ } catch (Throwable t) {
+ throw new AttributeException(toString() +
".setAttributeContent(" + target + "," + value + "," + references + "," +
+ nameSpaces + "): encountered " + t.toString() +
+ " while trying to set associated class in target
type.", t);
+ }
+ } else if(target!=null) {
+ throw new AttributeException(toString() +
".setAttributeContent(" + target + "," + value + "," + references + "," +
+ nameSpaces + "): could not set attribute in target.");
+ }
+
+ // simply return the modified target
+ return target;
+ }
+
+ /** singleton */
+ private static AssociatedClassAttribute associatedClassAttribute =
+ new AssociatedClassAttribute();
+
+ /** singleton accessor */
+ public static AssociatedClassAttribute getAssociatedClassAttribute() {
+ return associatedClassAttribute;
+ }
-}
+} // AssociatedClassAttribute
1.3 +16 -7 zoap/src/org/zoap/xml/meta/builtin/BooleanElement.java
Index: BooleanElement.java
===================================================================
RCS file:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/BooleanElement.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BooleanElement.java 2000/12/04 12:36:36 1.2
+++ BooleanElement.java 2001/01/03 10:23:55 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: BooleanElement.java,v 1.2 2000/12/04 12:36:36 jung Exp $
+ * $Id: BooleanElement.java,v 1.3 2001/01/03 10:23:55 jung Exp $
* Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
@@ -52,7 +52,7 @@
* XML element around java.lang.Boolean. Implemented as a singleton
* <br>
* @author $Author: jung $
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class BooleanElement extends PrimitiveElement {
@@ -60,8 +60,8 @@
/** constructor cannot be faked anymore */
private BooleanElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString()+"()");
setType(BooleanType.getBooleanType());
setAppearanceName("boolean");
@@ -77,9 +77,9 @@
/** global access */
public static BooleanElement getBooleanElement() {
- /* if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(BooleanElement.class.toString()+
- ".getBooleanElement()"+booleanElement+"\n");
+ /* if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(BooleanElement.class.toString()+
+ ".getBooleanElement()"+booleanElement+"");
*/
return booleanElement;
@@ -89,6 +89,9 @@
/*
* $Log: BooleanElement.java,v $
+ * Revision 1.3 2001/01/03 10:23:55 jung
+ * exception redesign. Improved null-pointer treatment. coherent environment and
logging facilities.
+ *
* Revision 1.2 2000/12/04 12:36:36 jung
* adopted to latest jboss container,
*
1.3 +13 -4 zoap/src/org/zoap/xml/meta/builtin/ByteElement.java
Index: ByteElement.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/ByteElement.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ByteElement.java 2000/12/04 12:36:36 1.2
+++ ByteElement.java 2001/01/03 10:23:55 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: ByteElement.java,v 1.2 2000/12/04 12:36:36 jung Exp $
+ * $Id: ByteElement.java,v 1.3 2001/01/03 10:23:55 jung Exp $
* Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
@@ -51,7 +51,7 @@
* XML wrapper around java.lang.Byte. Implemented as a singleton
* <br>
* @author $Author: jung $
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class ByteElement extends PrimitiveElement {
@@ -59,8 +59,8 @@
/** constructor cannot be faked anymore */
private ByteElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString()+"()");
setType(ByteType.getByteType());
setAppearanceName("byte");
@@ -85,6 +85,9 @@
/*
* $Log: ByteElement.java,v $
+ * Revision 1.3 2001/01/03 10:23:55 jung
+ * exception redesign. Improved null-pointer treatment. coherent environment and
logging facilities.
+ *
* Revision 1.2 2000/12/04 12:36:36 jung
* adopted to latest jboss container,
*
1.3 +14 -5 zoap/src/org/zoap/xml/meta/builtin/CharacterElement.java
Index: CharacterElement.java
===================================================================
RCS file:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/CharacterElement.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CharacterElement.java 2000/12/04 12:36:36 1.2
+++ CharacterElement.java 2001/01/03 10:23:55 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: CharacterElement.java,v 1.2 2000/12/04 12:36:36 jung Exp $
+ * $Id: CharacterElement.java,v 1.3 2001/01/03 10:23:55 jung Exp $
* Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
@@ -51,8 +51,8 @@
/** constructor cant be faked */
private CharacterElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString()+"()");
setType(CharacterType.getCharacterType());
setAppearanceName("character");
@@ -62,8 +62,8 @@
public static CharacterElement getCharacterElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(CharacterElement.class.toString()+".getCharacterElement()\n");
+ if(Environment.DEBUG_LEVEL>1)
+
Environment.CONSOLE.log(CharacterElement.class.toString()+".getCharacterElement()");
return charElement;
}
@@ -73,6 +73,9 @@
/*
* $Log: CharacterElement.java,v $
+ * Revision 1.3 2001/01/03 10:23:55 jung
+ * exception redesign. Improved null-pointer treatment. coherent environment and
logging facilities.
+ *
* Revision 1.2 2000/12/04 12:36:36 jung
* adopted to latest jboss container,
*
1.3 +91 -123 zoap/src/org/zoap/xml/meta/builtin/CharacterType.java
Index: CharacterType.java
===================================================================
RCS file:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/CharacterType.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CharacterType.java 2000/12/04 12:36:36 1.2
+++ CharacterType.java 2001/01/03 10:23:56 1.3
@@ -1,45 +1,22 @@
-/*
- * $Id: CharacterType.java,v 1.2 2000/12/04 12:36:36 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * $Source:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/CharacterType.java,v $
+ * The Zero-effort Object Access Package is a library to support XML/SOAP
serialisation and invocation.
+ * Copyright (c) 2000 infor business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.zoap.xml.meta.builtin;
@@ -49,98 +26,80 @@
import org.zoap.xml.TypeException;
import java.util.Map;
-
-public class CharacterType extends SimpleType {
-
- /** constructor cant be faked */
- private CharacterType() {
- setAssociatedClass(Character.class);
- setTypeName("character");
- }
-
- public Schema getTypeSchema() {
- return ZoapSchema.getZoapSchema();
- }
-
- public Object newInstance(Map attributes, Map references, Map nameSpaces) {
- return null;
- }
-
- /** return a usable and printable representation of the Character @arg object */
- public String getContent(Object object) throws TypeException {
-
- if(object!=null && !Character.isLetter(((Character) object).charValue()))
- throw new TypeException();
- if(object!=null)
- return object.toString();
-
- return null;
- }
-
- /** create a character from the given string */
- public Object setContent(Object target,String body, String verboseElements,Map
references,Map nameSpaces)
- throws TypeException {
-
- if(body!=null)
- if(body.length()==1)
- return new Character(body.charAt(0));
-
- throw new TypeException();
- }
+/**
+ * XmlType representing a single character
+ * @author jung
+ * @version $Revision: 1.3 $
+ */
- public boolean isStateless() {
- return true;
- }
+public class CharacterType extends SimpleType {
- private static CharacterType charType=new CharacterType();
+ /** how spelled */
+ public final static String TYPE_NAME = "character";
- public static CharacterType getCharacterType() {
- return charType;
- }
+ /** constructor cant be faked */
+ private CharacterType() {
+ setAssociatedClass(Character.class);
+ setTypeName(TYPE_NAME);
+ }
+
+ /** lazy, indirect reference to ZoapSchema to ease initialisation */
+ public Schema getTypeSchema() {
+ return ZoapSchema.getZoapSchema();
+ }
+
+ /**
+ * as with other primitives, the instantiation is not done until provided with
the body
+ * of the character tag, hence this returns null
+ */
+
+ public Object newInstance(Map attributes, Map references, Map nameSpaces) {
+ return null;
+ }
+
+ /**
+ * return a usable and printable representation of the Character @arg object
for which we usually simply say toString()
+ * overloads the general getContent(Object) method
+ */
+
+ public String getContent(Object object) throws TypeException {
+
+ if (object instanceof Character) {
+ if(!Character.isLetter(((Character) object).charValue())) {
+ throw new TypeException(toString() + ".getContent(" +
object +
+ "): could not encode non-letter character into XML");
+ } else
+ return object.toString();
+ } else
+ if(object!=null)
+ throw new TypeException(toString()+".getContent("+object+"): not a
java.lang.Character.");
+ else
+ return null;
+ }
+
+ /** create a character from the given body string */
+ public Object setContent(Object target, String body, String verboseElements,
Map references, Map nameSpaces)
+ throws TypeException {
+
+ try {
+ return new Character(body.charAt(0));
+ } catch (Throwable t) {
+ throw new TypeException(toString() + ".setContent(" + target +
"," + body + "," + verboseElements + "," +
+ references + "," + nameSpaces + "): encountered " +
t.toString() + " while trying to convert body to Character.", t);
+ }
+ }
+
+ /** important marker that hinders referencing until the body has arrived */
+ public boolean isStateless() {
+ return true;
+ }
+
+ /** singleton */
+ private static CharacterType charType = new CharacterType();
+
+ /** singleton accessor */
+ public static CharacterType getCharacterType() {
+ return charType;
+ }
}
-
-
-
-/*
- * $Log: CharacterType.java,v $
- * Revision 1.2 2000/12/04 12:36:36 jung
- * adopted to latest jboss container,
- *
- * added decimal and date
- *
- * removed some problems due to forward-referencing in meta-data
- *
- * added serialisation policy
- *
- * Revision 1.1.1.1 2000/08/10 21:08:01 jung
- * Initial import.
- *
- *
- * Revision 1.1.2.1 2000/08/04 17:20:20 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.2 2000/07/20 14:35:27 jung
- * some refactoring inside infor:xml
- *
- * Revision 1.1.2.1 2000/07/17 12:46:19 jung
- * refactored package and meta-model
- *
- * Revision 1.1.2.1 2000/07/13 12:46:25 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1.2.1 2000/07/11 08:08:35 jung
- * added functionality to store retrieve a part of a types elements
- * within "ignored" strings. Useful for writing generic handlers that
- * just process a part of the XML and transfer the rest.
- *
- * Revision 1.1.1.1 2000/07/06 14:11:28 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
1.3 +16 -7 zoap/src/org/zoap/xml/meta/builtin/ClassElement.java
Index: ClassElement.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/ClassElement.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ClassElement.java 2000/12/04 12:36:36 1.2
+++ ClassElement.java 2001/01/03 10:23:56 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: ClassElement.java,v 1.2 2000/12/04 12:36:36 jung Exp $
+ * $Id: ClassElement.java,v 1.3 2001/01/03 10:23:56 jung Exp $
* Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
@@ -62,8 +62,8 @@
/** constructor is empty */
public ClassElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString()+"()");
}
@@ -75,8 +75,8 @@
public Object[] getElementContents(Object object, boolean isNew, Properties
references)
throws ElementException {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(toString()+".getElementContents("+object+","+isNew+","+references+")\n");
+ if(Environment.DEBUG_LEVEL>1)
+
Environment.CONSOLE.log(toString()+".getElementContents("+object+","+isNew+","+references+")");
if(object!=null) {
if(object.getClass().isArray()) {
@@ -96,8 +96,8 @@
public Object addElementContent(Object object, Object value, Map references, Map
nameSpaces) {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(toString()+".addElementContent("+object+","+value+","+references+")\n");
+ if(Environment.DEBUG_LEVEL>1)
+
Environment.CONSOLE.log(toString()+".addElementContent("+object+","+value+","+references+")");
if(object!=null) {
@@ -138,6 +138,9 @@
/*
* $Log: ClassElement.java,v $
+ * Revision 1.3 2001/01/03 10:23:56 jung
+ * exception redesign. Improved null-pointer treatment. coherent environment and
logging facilities.
+ *
* Revision 1.2 2000/12/04 12:36:36 jung
* adopted to latest jboss container,
*
1.4 +6 -3 zoap/src/org/zoap/xml/meta/builtin/ClassType.java
Index: ClassType.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/ClassType.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ClassType.java 2000/12/22 15:49:44 1.3
+++ ClassType.java 2001/01/03 10:23:56 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: ClassType.java,v 1.3 2000/12/22 15:49:44 jung Exp $
+ * $Id: ClassType.java,v 1.4 2001/01/03 10:23:56 jung Exp $
* Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
@@ -60,8 +60,8 @@
/** empty constructor */
public ClassType() {
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + "()\n");
+ if (Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString() + "()");
}
/** class types are referencable */
@@ -73,6 +73,9 @@
/*
* $Log: ClassType.java,v $
+ * Revision 1.4 2001/01/03 10:23:56 jung
+ * exception redesign. Improved null-pointer treatment. coherent environment and
logging facilities.
+ *
* Revision 1.3 2000/12/22 15:49:44 jung
* repackaged thread pooling. Coherent environment. Exception extensions.
*
1.3 +71 -131 zoap/src/org/zoap/xml/meta/builtin/CollectionElement.java
Index: CollectionElement.java
===================================================================
RCS file:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/CollectionElement.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CollectionElement.java 2000/12/04 12:36:36 1.2
+++ CollectionElement.java 2001/01/03 10:23:56 1.3
@@ -1,48 +1,24 @@
-/*
- * $Id: CollectionElement.java,v 1.2 2000/12/04 12:36:36 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * $Source:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/CollectionElement.java,v $
+ * The Zero-effort Object Access Package is a library to support XML/SOAP
serialisation and invocation.
+ * Copyright (c) 2000 infor business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
package org.zoap.xml.meta.builtin;
import org.zoap.xml.Environment;
@@ -56,123 +32,78 @@
import java.util.Map;
/**
- * CollectionElement is a dedicated wrapper around arbitrary
- * one-dimensional Java structures.
+ * CollectionElement is a dedicated wrapper around arbitrary one-dimensional Java
structures. The associated class
+ * of the type should always be the array type that contains the
+ * corresponding component type. The actual class that is processed could be an
array or a collection.
+ * @author jung
+ * @version $Revision: 1.3 $
*/
public class CollectionElement extends Element {
-
- /** empty constructor */
- public CollectionElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
- }
+ /** access the collection or array */
+ public Object[] getElementContents(Object object, boolean isNew, Properties
references)
+ throws ElementException {
- /** access the collection or array */
- public Object[] getElementContents(Object object, boolean isNew, Properties
references)
- throws ElementException {
+ if (getType().getAssociatedClass().isInstance(object)) {
+ return new Object[] { object };
+ } else if (Collection.class.isInstance(object)) {
+ return ((Collection)object).toArray();
+ } else if (object.getClass().isArray()) {
+ return (Object[]) object;
+ } else
+ throw new ElementException(toString() +
+ ".getElementContents(" + object + "," + isNew + "," +
references +
+ "): associated class is neither array or collection.");
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+".getElementContents("+object+","+isNew+","+
- references+")\n");
+ } // getElementContents
- if(object!=null) {
- if(getType().getAssociatedClass().isInstance(object)) {
- return new Object[] {object};
- } else if(Collection.class.isInstance(object)) {
- return ((Collection) object).toArray();
- } else if (object.getClass().isArray()) {
- return (Object[]) object;
- } else
- throw new ElementException();
- } else
- return null;
+ /** if you are a collection, add the value to the incoming collection */
- } // getElementContents
+ public Object addElementContent(Object object, Object value, Map references,
Map nameSpaces)
+ throws ElementException {
- /**
- * if you are a collection, add the value to the incoming collection
- */
+ if (object != null) {
- public Object addElementContent(Object object, Object value, Map references, Map
nameSpaces) {
+ if (object.getClass().isArray()) {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+".getElementContents("+object+","+value+","+
- references+")\n");
+ try {
+ // read out the length of the former array
+ int length =
java.lang.reflect.Array.getLength(object);
- if(object!=null) {
+ // now create a new array that increases the
size by one
+ Object newArray =
+
java.lang.reflect.Array.newInstance(object.getClass().getComponentType(),
+ length + 1);
- if(object.getClass().isArray()) {
+ // copy the content
+ System.arraycopy(object, 0, newArray, 0,
length);
- // read out the length of the former array
- int length=java.lang.reflect.Array.getLength(object);
+ // place the additional value behind
+ java.lang.reflect.Array.set(newArray, length,
value);
- // now create a new array that increases the size by one
- Object newArray=
-
java.lang.reflect.Array.newInstance(object.getClass().getComponentType(),
- length+1);
+ // and return the stuff
+ return newArray;
+ } catch (Throwable t) {
+ throw new ElementException(toString() +
".addElementContent(" + object + "," + value + "," + references + "," +
+ nameSpaces + "): encountered " +
t.toString() +
+ " while trying to add element to array.",
t);
+ }
- // copy the content
- System.arraycopy(object,0,newArray,0,length);
+ } else if (Collection.class.isInstance(object)) {
- // place the additional value behind
- java.lang.reflect.Array.set(newArray,length,value);
+ ((Collection)object).add(value);
- // and return the stuff
- return newArray;
+ return object;
- } else if(Collection.class.isInstance(object)) {
+ } else {
+ return value;
+ }
+ }
- ((Collection) object).add(value);
+ return null;
+ }
- return object;
-
- } else {
- return value;
- }
- }
-
- return null;
- }
-
}
-/*
- * $Log: CollectionElement.java,v $
- * Revision 1.2 2000/12/04 12:36:36 jung
- * adopted to latest jboss container,
- *
- * added decimal and date
- *
- * removed some problems due to forward-referencing in meta-data
- *
- * added serialisation policy
- *
- * Revision 1.1.1.1 2000/08/10 21:08:03 jung
- * Initial import.
- *
- *
- * Revision 1.1.2.1 2000/08/04 17:20:20 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.1 2000/07/17 12:46:19 jung
- * refactored package and meta-model
- *
- * Revision 1.1.2.1 2000/07/13 12:46:25 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.2 2000/07/06 16:55:06 jung
- * moved the default binding caches in order to make apartments
- * with different versions of the same class possible.
- *
- * Revision 1.1.1.1 2000/07/06 14:11:28 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+
1.3 +70 -95 zoap/src/org/zoap/xml/meta/builtin/CollectionType.java
Index: CollectionType.java
===================================================================
RCS file:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/CollectionType.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CollectionType.java 2000/12/04 12:36:37 1.2
+++ CollectionType.java 2001/01/03 10:23:56 1.3
@@ -1,45 +1,22 @@
-/*
- * $Id: CollectionType.java,v 1.2 2000/12/04 12:36:37 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * $Source:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/CollectionType.java,v $
+ * The Zero-effort Object Access Package is a library to support XML/SOAP
serialisation and invocation.
+ * Copyright (c) 2000 infor business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.zoap.xml.meta.builtin;
@@ -53,61 +30,59 @@
/**
* this type implements a variety of collections (by setting its associatedClass to
- * an array or a collection). It can be given a set of elements that will be
- * inserted into this collection.
+ * an array or a collection). It can be given a set of elements that will be
inserted into this collection.
+ * @author jung
+ * @version $Revision: 1.3 $
*/
public class CollectionType extends ComplexType {
- /** empty constructor */
- public CollectionType() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
- }
-
- /** associated class must be array or collection */
- public void setAssociatedClass(Class forClass) {
-
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+".setAssociatedClass("+forClass+")\n");
-
- if(forClass!= null && !forClass.isArray() &&
!Collection.class.isAssignableFrom(forClass))
- throw new RuntimeException("Must associated array or collection.");
-
- super.setAssociatedClass(forClass);
- }
-
- /** the newInstance method caters for array and collection construction */
- public Object newInstance(Map attributes, Map references, Map nameSpaces) throws
TypeException {
-
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(toString()+".newInstance("+attributes+","+references+","+nameSpaces+")");
-
- if(getAssociatedClass()!=null) {
- if(getAssociatedClass().isArray()) {
- return
java.lang.reflect.Array.newInstance(getAssociatedClass().getComponentType(),0);
- } else {
- try{
- return getAssociatedClass().newInstance();
- } catch(IllegalAccessException e) {
- throw new TypeException();
- } catch(InstantiationException e) {
- throw new TypeException();
- }
- }
- } else
- return null;
- }
-
- /**
- * since arrays have static size, we cannot reference the intermediate results
- * in higher-level elements,instead have to wait until the tag is over
- */
-
- public boolean isStateless() {
- if(getAssociatedClass().isArray())
- return true;
- else
- return false;
- }
+ /** empty constructor */
+ public CollectionType() {
+ if (Environment.DEBUG_LEVEL > 1)
+ Environment.CONSOLE.log(toString() + "()");
+ }
+
+ /** associated class must be array or collection */
+ public void setAssociatedClass(Class forClass) {
+
+ if (Environment.DEBUG_LEVEL > 1)
+ Environment.CONSOLE.log(toString() + ".setAssociatedClass(" +
forClass + ")");
+
+ if (forClass != null && !forClass.isArray() &&
!Collection.class.isAssignableFrom(forClass))
+ throw new RuntimeException(toString() +".setAssociatedClass("
+ forClass +
+ "): must be array or collection.");
+
+ super.setAssociatedClass(forClass);
+ }
+
+ /** the newInstance method caters for array and collection construction */
+ public Object newInstance(Map attributes, Map references, Map nameSpaces)
throws TypeException {
+
+ if (Environment.DEBUG_LEVEL > 1)
+ Environment.CONSOLE.log(toString() + ".newInstance(" +
attributes + "," + references + "," + nameSpaces + ")");
+
+ try {
+ if (getAssociatedClass().isArray()) {
+ return
java.lang.reflect.Array.newInstance(getAssociatedClass().getComponentType(), 0);
+ } else {
+ return getAssociatedClass().newInstance();
+ }
+ } catch (Throwable t) {
+ throw new TypeException(toString() + ".newInstance(" +
attributes + "," + references + "," + nameSpaces +
+ "): encountered " + t.toString() + " while trying to
instantiate associated collection.", t);
+ }
+ }
+
+ /**
+ * since arrays have static size and are built up incrementally, we cannot
reference the intermediate results
+ * in higher-level elements,instead have to wait until the tag is over
+ */
+
+ public boolean isStateless() {
+ if (getAssociatedClass().isArray())
+ return true;
+ else
+ return false;
+ }
}
1.2 +5 -5 zoap/src/org/zoap/xml/meta/builtin/DateElement.java
Index: DateElement.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/DateElement.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DateElement.java 2000/12/04 12:36:37 1.1
+++ DateElement.java 2001/01/03 10:23:56 1.2
@@ -1,5 +1,5 @@
/*
- * $Id: DateElement.java,v 1.1 2000/12/04 12:36:37 jung Exp $
+ * $Id: DateElement.java,v 1.2 2001/01/03 10:23:56 jung Exp $
* Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
@@ -51,8 +51,8 @@
/** constructor cant be faked */
private DateElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString()+"()");
setType(DateType.getDateType());
setAppearanceName("date");
@@ -62,8 +62,8 @@
public static DateElement getDateElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(DateElement.class.toString()+".getDateElement()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(DateElement.class.toString()+".getDateElement()");
return dateElement;
}
1.2 +79 -80 zoap/src/org/zoap/xml/meta/builtin/DateType.java
Index: DateType.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/DateType.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DateType.java 2000/12/04 12:36:37 1.1
+++ DateType.java 2001/01/03 10:23:56 1.2
@@ -1,45 +1,22 @@
/*
- * $Id: DateType.java,v 1.1 2000/12/04 12:36:37 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * $Source: /products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/DateType.java,v
$
+ * The Zero-effort Object Access Package is a library to support XML/SOAP
serialisation and invocation.
+ * Copyright (c) 2000 infor business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.zoap.xml.meta.builtin;
@@ -51,50 +28,72 @@
import java.util.Map;
+/**
+ * simple type mediating between java.util.Date and zoap:date
+ * @author jung
+ * @version $Revision: 1.2 $
+ */
+
public class DateType extends SimpleType {
- /** constructor cant be faked */
- private DateType() {
- setAssociatedClass(Date.class);
- setTypeName("date");
- }
-
- public Schema getTypeSchema() {
- return ZoapSchema.getZoapSchema();
- }
-
- public Object newInstance(Map attributes, Map references, Map nameSpaces) {
- return null;
- }
+ /** how spelled */
+ public final static String TYPE_NAME = "date";
- /** return a usable and printable representation of the Character @arg object */
- public String getContent(Object object) throws TypeException {
+ /** constructor cant be faked */
+ private DateType() {
+ setAssociatedClass(Date.class);
+ setTypeName(TYPE_NAME);
+ }
+
+ /** lazy access to ease instantiation */
+
+ public Schema getTypeSchema() {
+ return ZoapSchema.getZoapSchema();
+ }
+
+ /**
+ * as other wrappers around classes that finalize much in their constructor,
this delays instantiation until the body is seen
+ */
+ public Object newInstance(Map attributes, Map references, Map nameSpaces) {
+ return null;
+ }
+ /** return a usable and printable representation of the Date @arg object */
+ public String getContent(Object object) throws TypeException {
if(object instanceof Date)
- return String.valueOf(((Date) object).getTime());
-
- return null;
- }
-
- /** create a character from the given string */
- public Object setContent(Object target,String body, String verboseElements,Map
references,Map nameSpaces)
- throws TypeException {
-
- if(body!=null)
- return new Date(new Long(body).longValue());
-
- throw new TypeException();
- }
-
- public boolean isStateless() {
- return true;
- }
-
- private static DateType dateType=new DateType();
-
- public static DateType getDateType() {
- return dateType;
- }
+ return String.valueOf(((Date)object).getTime());
+ else
+ if(object!=null)
+ throw new TypeException(toString()+".getContent("+object+"): not a
java.util.Date.");
+ else
+ return null;
+ }
+
+ /** create a character from the given string */
+ public Object setContent(Object target, String body, String verboseElements,
Map references, Map nameSpaces)
+ throws TypeException {
+
+ try {
+ return new Date(
+ new Long(body).longValue());
+ } catch (Throwable t) {
+ throw new TypeException(toString() + ".setContent(" + target +
"," + body + "," + verboseElements + "," + references + "," +
+ nameSpaces + "): encountered " + t.toString() + " while trying
to convert body to Date.", t);
+ }
+ }
+
+ /** prohibit early referencing */
+ public boolean isStateless() {
+ return true;
+ }
+
+ /** singleton */
+ private static DateType dateType = new DateType();
+
+ /** singleton access */
+ public static DateType getDateType() {
+ return dateType;
+ }
}
1.2 +14 -5 zoap/src/org/zoap/xml/meta/builtin/DecimalElement.java
Index: DecimalElement.java
===================================================================
RCS file:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/DecimalElement.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DecimalElement.java 2000/12/04 12:36:37 1.1
+++ DecimalElement.java 2001/01/03 10:23:56 1.2
@@ -1,5 +1,5 @@
/*
- * $Id: DecimalElement.java,v 1.1 2000/12/04 12:36:37 jung Exp $
+ * $Id: DecimalElement.java,v 1.2 2001/01/03 10:23:56 jung Exp $
* Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
@@ -51,7 +51,7 @@
/**
* XML element around java.lang.Boolean. Implemented as a singleton <br>
* @author $Author: jung $
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class DecimalElement extends PrimitiveElement {
@@ -59,8 +59,8 @@
/** constructor cannot be faked anymore */
private DecimalElement() {
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + "()\n");
+ if (Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString() + "()");
setType(DecimalType.getDecimalType());
setAppearanceName("decimal");
@@ -82,6 +82,9 @@
/*
* $Log: DecimalElement.java,v $
+ * Revision 1.2 2001/01/03 10:23:56 jung
+ * exception redesign. Improved null-pointer treatment. coherent environment and
logging facilities.
+ *
* Revision 1.1 2000/12/04 12:36:37 jung
* adopted to latest jboss container,
*
1.3 +39 -83 zoap/src/org/zoap/xml/meta/builtin/DefaultBinding.java
Index: DefaultBinding.java
===================================================================
RCS file:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/DefaultBinding.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DefaultBinding.java 2000/12/04 12:36:37 1.2
+++ DefaultBinding.java 2001/01/03 10:23:56 1.3
@@ -1,45 +1,22 @@
-/*
- * $Id: DefaultBinding.java,v 1.2 2000/12/04 12:36:37 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+/*
+ * $Source:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/DefaultBinding.java,v $
+ * The Zero-effort Object Access Package is a library to support XML/SOAP
serialisation and invocation.
+ * Copyright (c) 2000 infor business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
- * License Statement
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.zoap.xml.meta.builtin;
@@ -78,7 +55,7 @@
* information on the fly.
* <br>
* @author $Author: jung $
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class DefaultBinding extends Binding {
@@ -86,8 +63,8 @@
/** constructor is empty */
public DefaultBinding() {
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
+ if (Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString()+"()");
addSchema(XmlSchema.getXmlSchema());
addSchema(ZoapSchema.getZoapSchema());
@@ -120,7 +97,8 @@
newCollectionType.setAssociatedClass(Class.forName("[L"+subElement.getType().getAssociatedClass().
getName()+";",true,Thread.currentThread().getContextClassLoader()));
} catch(ClassNotFoundException e) {
- throw new RuntimeException("Array construction failed."+e);
+ throw new RuntimeException(toString()+
+ ".getElement("+name+"): encountered "+e.toString()+ " while
trying to construct array.");
}
newCollectionType.addElement(subElement);
addType(newCollectionType);
@@ -165,7 +143,12 @@
} // if
} catch(ClassNotFoundException e) {
- throw new RuntimeException("Collection type fucked
up."+collectionName);
+ if(Environment.LOG_LEVEL>1) {
+ Environment.CONSOLE.error(toString()+".getElement("+name+"):
encountered "+e.toString()+" while trying to instantiate collection.");
+ Environment.CONSOLE.exception(e);
+ }
+
+ throw new RuntimeException(toString()+".getElement("+name+"):
encountered "+e.toString()+" while trying to instantiate collection.");
} // try
} // if
@@ -199,8 +182,8 @@
public Schema getSchema(URN urn) {
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+".getSchema(" + urn + ")\n");
+ if (Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString()+".getSchema(" + urn + ")");
Schema result=super.getSchema(urn);
@@ -213,9 +196,9 @@
result =
constructClassSchema(urn);
} catch(ClassNotFoundException e) {
- if((Environment.DEBUG_XML && Environment.DEBUG_XML_META) ||
- (Environment.LOG_XML>0 && Environment.LOG_XML_META>0)) {
- Environment.out.print(toString()+".getSchema("+urn+")\n");
+ if((Environment.DEBUG_LEVEL>1) ||
+ (Environment.LOG_LEVEL>1)) {
+ Environment.CONSOLE.log(toString()+".getSchema("+urn+")");
}
}
@@ -233,8 +216,8 @@
public Element findElementCompatibleTo(Object object, Class clazz) {
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.println("DefaultBinding.findElementCompatibleTo(" + object +
","+clazz+")");
+ if (Environment.DEBUG_LEVEL>1)
+
Environment.CONSOLE.log("DefaultBinding.findElementCompatibleTo(" + object +
","+clazz+")");
if(clazz==null)
if(object==null)
@@ -252,8 +235,8 @@
public Type findTypeCompatibleTo(Object object,Class clazz) {
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.println("DefaultBinding.findTypeCompatibleTo("
+ object + ","+ clazz+")");
+ if (Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log("DefaultBinding.findTypeCompatibleTo("
+ object + ","+ clazz+")");
Element element=findElementCompatibleTo(object,clazz);
@@ -273,8 +256,8 @@
*/
protected Element getCanonicalElementForClass(Class clazz) {
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(toString()+".getCanonicalElementForClass(" + clazz + ")\n");
+ if (Environment.DEBUG_LEVEL>1)
+
Environment.CONSOLE.log(toString()+".getCanonicalElementForClass(" + clazz + ")");
if (Boolean.class.isAssignableFrom(clazz) ||
boolean.class.isAssignableFrom(clazz))
return BooleanElement.getBooleanElement();
@@ -505,8 +488,8 @@
// singleton accessor
public static DefaultBinding getDefaultBinding() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(DefaultBinding.class.toString()+".getDefaultBinding()");
+ if(Environment.DEBUG_LEVEL>1)
+
Environment.CONSOLE.log(DefaultBinding.class.toString()+".getDefaultBinding()");
if(defaultBinding==null)
synchronized(DefaultBinding.class) {
@@ -517,31 +500,4 @@
return defaultBinding;
}
}
-
-
- /** the default mapping of Java objects to XML elements/types
- public Element getCanonicalElementForObject(Object object) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(toString()+".getCanonicalElementForObject(" + object + ")\n");
-
- if (object == null)
- return getClassElement(getClassSchema(Object.class),
Object.class);
-
- return getCanonicalElementForClass(object.getClass());
- }
-
- /** the default mapping of Java objects to XML elements/types
- public Type getCanonicalTypeForObject(Object object) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+".getCanonicalTypeForObject("
+ object + ")\n");
-
- if (object == null)
- return getClassElement(getClassSchema(Object.class),
Object.class).getType();
-
- return getCanonicalTypeForClass(object.getClass());
- }
-
- */
1.3 +15 -6 zoap/src/org/zoap/xml/meta/builtin/DoubleElement.java
Index: DoubleElement.java
===================================================================
RCS file:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/DoubleElement.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DoubleElement.java 2000/12/04 12:36:38 1.2
+++ DoubleElement.java 2001/01/03 10:23:56 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: DoubleElement.java,v 1.2 2000/12/04 12:36:38 jung Exp $
+ * $Id: DoubleElement.java,v 1.3 2001/01/03 10:23:56 jung Exp $
* Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
@@ -51,7 +51,7 @@
* XML wrapper around java.lang.Double Implemented as a singleton
* <br>
* @author $Author: jung $
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class DoubleElement extends PrimitiveElement {
@@ -59,8 +59,8 @@
/** constructor cannot be faked anymore */
private DoubleElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString()+"()");
setType(DoubleType.getDoubleType());
setAppearanceName("double");
@@ -76,8 +76,8 @@
/** global access */
public static DoubleElement getDoubleElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(DoubleElement.class.toString()+".getDoubleElement()\n");
+ if(Environment.DEBUG_LEVEL>1)
+
Environment.CONSOLE.log(DoubleElement.class.toString()+".getDoubleElement()");
return doubleElement;
}
@@ -86,6 +86,9 @@
/*
* $Log: DoubleElement.java,v $
+ * Revision 1.3 2001/01/03 10:23:56 jung
+ * exception redesign. Improved null-pointer treatment. coherent environment and
logging facilities.
+ *
* Revision 1.2 2000/12/04 12:36:38 jung
* adopted to latest jboss container,
*
1.4 +115 -141 zoap/src/org/zoap/xml/meta/builtin/FieldAttribute.java
Index: FieldAttribute.java
===================================================================
RCS file:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/FieldAttribute.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FieldAttribute.java 2000/12/04 12:36:38 1.3
+++ FieldAttribute.java 2001/01/03 10:23:57 1.4
@@ -1,21 +1,22 @@
-/*
- * $Id: FieldAttribute.java,v 1.3 2000/12/04 12:36:38 jung Exp $
- * Copyright (c) 2000 infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+/*
+ * $Source:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/FieldAttribute.java,v $
+ * The Zero-effort Object Access Package is a library to support XML/SOAP
serialisation and invocation.
+ * Copyright (c) 2000 infor business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -34,162 +35,126 @@
/**
* This is a dedicated XML-attribute wrapper around an arbitrary Java field. This
wrapper
* must be provided with a fieldname, a Java class to which this field belongs, and
- * an appropriate SimpleType into which the field value can be serialised to and
can be deserialised
- * from.
+ * an appropriate SimpleType into which the field value can be serialised to and
can be deserialised from.
+ * @author jung
+ * @version $Revision: 1.4 $
*/
public class FieldAttribute extends Attribute {
- /** the associated field */
- private Field associatedField;
+ /** the associated field */
+ private Field associatedField;
- /** the name of the associatedField */
- private String fieldName;
+ /** the name of the associatedField */
+ private String fieldName;
- /** the name of the associatedClass, i.e., the one carrying the field */
- private Class associatedClass;
+ /** the name of the associatedClass, i.e., the one carrying the field */
+ private Class associatedClass;
- /** empty constructor */
- public FieldAttribute() {
+ /** access the associated class */
+ public Class getAssociatedClass() {
+ return associatedClass;
+ }
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
+ /** sets the associated class */
+ public void setAssociatedClass(Class forClass) {
+ associatedClass = forClass;
+ }
- }
- /** access the associated class */
- public Class getAssociatedClass() {
- return associatedClass;
- }
+ /** access the fieldname */
+ public String getFieldName() {
+ return fieldName;
+ }
- /** sets the associated class */
- public void setAssociatedClass(Class forClass) {
- associatedClass=forClass;
- }
+ /** set the field name */
+ public void setFieldName(String fieldName) {
+ this.fieldName = fieldName;
+ }
+ public void setAssociatedField(Field field) {
+ associatedField = field;
+ }
- /** access the fieldname*/
- public String getFieldName() {
- return fieldName;
- }
+ public Field getAssociatedField() {
+ return associatedField;
+ }
- /** set the field name */
- public void setFieldName(String fieldName) {
- this.fieldName=fieldName;
- }
- public void setAssociatedField(Field field) {
- associatedField = field;
- }
+ /**
+ * accesses the field as an element. Lazily refreshes the internal reflection
information
+ * and (if successful) uses the field.get method to retrieve the (single)
value that is then handed to the associated type.
+ */
- public Field getAssociatedField() {
- return associatedField;
- }
+ public Object getAttributeContent(Object object, boolean isNew, Properties
references)
+ throws AttributeException {
+ if (isNew) {
- /**
- * accesses the field as an element. Lazily refreshes the internal reflection
information
- * and (if successful) uses the field.get method to retrieve the (single) value
that is then
- * handed to the associated type.
- */
-
- public Object getAttributeContent(Object object, boolean isNew, Properties
references)
- throws AttributeException {
-
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(toString()+"getAttributeContent("+object+","+isNew+","+references+")\n");
-
- if(isNew && object!=null) {
-
- if(associatedField==null) {
- try{
- initialize();
- } catch(NoSuchFieldException e) {
- throw new AttributeException();
- } catch(IllegalAccessException e) {
- throw new AttributeException();
- }
- }
-
- try{
- return associatedField.get(object);
- } catch(IllegalAccessException e) {
- throw new AttributeException();
- }
-
- } else
- return null;
- }
-
-
- /**
- * setAttributeContent simply sets the value of the field. Lazily refreshes the
internal
- * reflection information. Uses the field.set method.
- */
-
-
- public Object setAttributeContent(Object object, Object value, Map references,
Map nameSpaces)
- throws AttributeException {
-
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(toString()+".setAttributeContent("+object+","+value+","+references+")\n");
-
- if(object!=null) {
-
- if(associatedField==null) {
- try{
- initialize();
- } catch(NoSuchFieldException e) {
- throw new AttributeException();
- } catch(IllegalAccessException e) {
- throw new AttributeException();
- }
- }
-
- try{
- associatedField.set(object,value);
- } catch(IllegalAccessException e) {
- throw new AttributeException();
- }
+ try {
- }
+ if (associatedField == null)
+ initialize();
+
+ return associatedField.get(object);
+ } catch (Throwable t) {
+ throw new AttributeException(toString() +
".getAttributeContent(" + object + "," + isNew + "," + references + "): encountered "
+ t.toString() +
+ " while trying to initialise/access attribute.", t);
+ }
+
+ } else
+ return null;
+ }
+
+
+ /**
+ * setAttributeContent simply sets the value of the field. Lazily refreshes
the internal
+ * reflection information. Uses the field.set method.
+ */
+
+
+ public Object setAttributeContent(Object object, Object value, Map references,
Map nameSpaces)
+ throws AttributeException {
- return object;
- }
+ if (Environment.DEBUG_LEVEL > 1)
+ Environment.CONSOLE.log(toString() + ".setAttributeContent(" +
object + "," + value + "," + references + ")");
- /**
- * a private initializer that refreshes internal representations when switching
from
- * configuration time to runtime.
- */
-
- private void initialize() throws NoSuchFieldException, IllegalAccessException {
- // check that the class hes been set
- if(getAssociatedClass()!=null) {
- Field testField=
- getAssociatedClass().
- getDeclaredField(fieldName);
- testField.setAccessible(true);
- associatedField=testField;
+ if (object != null) {
+
+ try {
+
+ if (associatedField == null)
+ initialize();
+
+ associatedField.set(object, value);
+ } catch (Throwable t) {
+ throw new AttributeException(toString() +
".setAttributeContent(" + object + "," + value + "," + references + "," +
+ nameSpaces + "): encountered " + t.toString() +
+ " while trying to initialise/access the associated
field.", t);
+ }
+
+ }
+
+ return object;
+ }
+
+ /** a private initializer that refreshes internal representations when
switching from configuration time to runtime. */
+
+ private void initialize() throws NoSuchFieldException, IllegalAccessException {
+ // check that the class hes been set
+ if (getAssociatedClass() != null) {
+ Field testField =
+ getAssociatedClass().
+ getDeclaredField(fieldName);
+ testField.setAccessible(true);
+ associatedField = testField;
+ }
+ } // initialize
+
+ /** better pretty-printer */
+ public String toString() {
+ return super.toString()+":"+getAppearanceName()+"."+fieldName;
}
- } // initialize
}
-/*
- * $Log: FieldAttribute.java,v $
- * Revision 1.3 2000/12/04 12:36:38 jung
- * adopted to latest jboss container,
- *
- * added decimal and date
- *
- * removed some problems due to forward-referencing in meta-data
- *
- * added serialisation policy
- *
- * Revision 1.2 2000/09/04 16:41:18 jung
- * public accessors to the associated reflection field allow
- * extensions of this structure.
- *
- * Revision 1.1.1.1 2000/08/10 21:08:07 jung
- * Initial import.
- */
1.3 +113 -168 zoap/src/org/zoap/xml/meta/builtin/FieldElement.java
Index: FieldElement.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/FieldElement.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FieldElement.java 2000/12/04 12:36:38 1.2
+++ FieldElement.java 2001/01/03 10:23:57 1.3
@@ -1,14 +1,22 @@
-/*
- * $Id: FieldElement.java,v 1.2 2000/12/04 12:36:38 jung Exp $
- * Copyright 2000 by infor: business solutions AG
- * Hauerstra�e 12, D-66299 Friedrichsthal, Germany
- * All rights reserved.
- *
- * This software is the confidential and proprietary information
- * of infor: business solutions AG ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with infor AG.
+/*
+ * $Source:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/FieldElement.java,v $
+ * The Zero-effort Object Access Package is a library to support XML/SOAP
serialisation and invocation.
+ * Copyright (c) 2000 infor business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.zoap.xml.meta.builtin;
@@ -26,179 +34,107 @@
/**
* This is a dedicated XML-element wrapper around an arbitrary Java field. This
wrapper
* must be provided with a fieldname, a Java class to which this field belongs, and
- * an appropriate type into which the field value can be serialised to and can be
deserialised
- * from.
+ * an appropriate type into which the field value can be serialised to and can be
deserialised from.
+ * @author jung
+ * @version $Revision: 1.3 $
*/
public class FieldElement extends Element {
- /** the associated field */
- private Field associatedField;
+ /** the associated field */
+ private Field associatedField;
- /** the name of the associatedField */
- private String fieldName;
+ /** the name of the associatedField */
+ private String fieldName;
- /** the name of the associatedClass, i.e., the one carrying the field */
- private Class associatedClass;
+ /** the name of the associatedClass, i.e., the one carrying the field */
+ private Class associatedClass;
- /**
- * constructor is empty, we try to
- * build the field lazily when all initialisation
- * has been done
- */
-
- public FieldElement() {
-
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
-
- }
-
- /** access the associated class */
- public Class getAssociatedClass() {
- return associatedClass;
- }
-
- /** sets the associated class */
- public void setAssociatedClass(Class forClass) {
- associatedClass=forClass;
- }
-
- /** access the fieldname*/
- public String getFieldName() {
- return fieldName;
- }
-
- /** set the field name */
- public void setFieldName(String fieldName) {
- this.fieldName=fieldName;
- }
-
- public Field getAssociatedField() {
- return associatedField;
- }
-
- /**
- * accesses the field as an element. Lazily refreshes the internal reflection
information
- * and (if successful) uses the field.get method to retrieve the (single) value
that is then
- * handed to the associated type.
- */
-
- public Object[] getElementContents(Object object, boolean isNew, Properties
references)
- throws ElementException {
-
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+".getElementContents("+object+","+isNew+","+
- references+")\n");
-
- if(isNew && object!=null) {
- if(associatedField==null) {
- try{
- initialize();
- } catch(NoSuchFieldException e) {
- throw new ElementException();
- } catch(IllegalAccessException e) {
- throw new ElementException();
- }
- }
-
- try{
- return new Object[] {associatedField.get(object)};
- } catch(IllegalAccessException e) {
- throw new ElementException();
- }
-
- } else
- return null;
- }
-
-
- /**
- * addElementContent simply sets the value of the field. Lazily refreshes the
internal
- * reflection information. Uses the field.set method.
- */
-
- public Object addElementContent(Object object, Object value, Map references, Map
nameSpaces) throws ElementException {
-
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(toString()+".addElementContent("+object+","+value+","+references+")\n");
-
- if(object!=null) {
- if(associatedField==null) {
- try{
- initialize();
- } catch(NoSuchFieldException e) {
- throw new ElementException();
- } catch(IllegalAccessException e) {
- throw new ElementException();
- }
- }
-
- try{
- associatedField.set(object,value);
- } catch(IllegalAccessException e) {
- throw new ElementException();
- }
- }
-
- return object;
- }
-
-
- /**
- * a private initializer that refreshes the internal representation when
- * switching from configuration-time to runtime. Builds up the derived
- * reflection information only once
- */
-
- protected void initialize() throws NoSuchFieldException, IllegalAccessException {
- // assure that the class has been set
- if(getAssociatedClass()!=null) {
- Field testField=
- getAssociatedClass().
- getDeclaredField(fieldName);
- testField.setAccessible(true);
- associatedField=testField;
- }
- }
+ /** access the associated class */
+ public Class getAssociatedClass() {
+ return associatedClass;
+ }
+
+ /** sets the associated class */
+ public void setAssociatedClass(Class forClass) {
+ associatedClass = forClass;
+ }
+
+ /** access the fieldname */
+ public String getFieldName() {
+ return fieldName;
+ }
+
+ /** set the field name */
+ public void setFieldName(String fieldName) {
+ this.fieldName = fieldName;
+ }
+
+ /** access the reflection field */
+ public Field getAssociatedField() {
+ return associatedField;
+ }
+
+ /**
+ * accesses the field as an element. Lazily refreshes the internal reflection
information
+ * and (if successful) uses the field.get method to retrieve the (single)
value that is then handed to the associated type.
+ */
+
+ public Object[] getElementContents(Object object, boolean isNew, Properties
references)
+ throws ElementException {
+ if (isNew) {
+ try {
+ if (associatedField == null)
+ initialize();
+
+
+ return new Object[] { associatedField.get(object) };
+ } catch (Throwable t) {
+ throw new ElementException(toString() +
".getElementContents(" + object + "," + isNew + "," + references +
+ "): encountered " + t.toString() +" while trying to
initialise/access field.", t);
+ }
+
+ } else
+ return null;
+ }
+
+
+ /**
+ * addElementContent simply sets the value of the field. Lazily refreshes the
internal
+ * reflection information. Uses the field.set method.
+ */
+
+ public Object addElementContent(Object object, Object value, Map references,
Map nameSpaces) throws ElementException {
+
+ if (object != null) {
+ try {
+ if (associatedField == null)
+ initialize();
+ associatedField.set(object, value);
+ } catch (Throwable t) {
+ throw new ElementException(toString() +
".addElementContent(" + object + "," + value + "," + references + "," +
+ nameSpaces + "): encountered " + t.toString() + "
while trying to initialise/access field.", t);
+ }
+ }
+
+ return object;
+ }
+
+
+ /**
+ * a private initializer that refreshes the internal representation when
+ * switching from configuration-time to runtime. Builds up the derived
reflection information only once
+ */
+
+ protected void initialize() throws NoSuchFieldException,
IllegalAccessException {
+ // assure that the class has been set
+ if (getAssociatedClass() != null) {
+ Field testField = getAssociatedClass().
+ getDeclaredField(fieldName);
+ testField.setAccessible(true);
+ associatedField = testField;
+ }
+ }
} // FieldElement
-/*
- * $Log: FieldElement.java,v $
- * Revision 1.2 2000/12/04 12:36:38 jung
- * adopted to latest jboss container,
- *
- * added decimal and date
- *
- * removed some problems due to forward-referencing in meta-data
- *
- * added serialisation policy
- *
- * Revision 1.1.1.1 2000/08/10 21:08:08 jung
- * Initial import.
- *
- *
- * Revision 1.1.2.1 2000/08/04 17:20:20 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.1 2000/07/17 12:46:19 jung
- * refactored package and meta-model
- *
- * Revision 1.1.2.1 2000/07/13 12:46:25 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.2 2000/07/06 16:55:06 jung
- * moved the default binding caches in order to make apartments
- * with different versions of the same class possible.
- *
- * Revision 1.1.1.1 2000/07/06 14:11:29 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
1.3 +3 -3 zoap/src/org/zoap/xml/meta/builtin/FieldNameAttribute.java
Index: FieldNameAttribute.java
===================================================================
RCS file:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/FieldNameAttribute.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FieldNameAttribute.java 2000/12/04 12:36:38 1.2
+++ FieldNameAttribute.java 2001/01/03 10:23:57 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: FieldNameAttribute.java,v 1.2 2000/12/04 12:36:38 jung Exp $
+ * $Id: FieldNameAttribute.java,v 1.3 2001/01/03 10:23:57 jung Exp $
* Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
@@ -76,8 +76,8 @@
public Object setAttributeContent(Object target, Object value, Map references,
Map nameSpaces)
throws AttributeException {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+".setAttributeContent("+target+","+value+","+
+ if(Environment.DEBUG_LEVEL>1)
+
Environment.CONSOLE.log(toString()+".setAttributeContent("+target+","+value+","+
references+","+nameSpaces+")");
if(target instanceof FieldElement) {
1.3 +15 -6 zoap/src/org/zoap/xml/meta/builtin/FloatElement.java
Index: FloatElement.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/FloatElement.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FloatElement.java 2000/12/04 12:36:38 1.2
+++ FloatElement.java 2001/01/03 10:23:57 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: FloatElement.java,v 1.2 2000/12/04 12:36:38 jung Exp $
+ * $Id: FloatElement.java,v 1.3 2001/01/03 10:23:57 jung Exp $
* Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
@@ -52,7 +52,7 @@
* XML wrapper around java.lang.Float Implemented as a singleton
* <br>
* @author $Author: jung $
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class FloatElement extends PrimitiveElement {
@@ -60,8 +60,8 @@
/** constructor cannot be faked anymore */
private FloatElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+".()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString()+".()");
setType(FloatType.getFloatType());
setAppearanceName("float");
@@ -77,8 +77,8 @@
/** global access */
public static FloatElement getFloatElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(FloatElement.class.toString()+".getFloatElement()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(FloatElement.class.toString()+".getFloatElement()");
return floatElement;
}
@@ -87,6 +87,9 @@
/*
* $Log: FloatElement.java,v $
+ * Revision 1.3 2001/01/03 10:23:57 jung
+ * exception redesign. Improved null-pointer treatment. coherent environment and
logging facilities.
+ *
* Revision 1.2 2000/12/04 12:36:38 jung
* adopted to latest jboss container,
*
1.3 +15 -6 zoap/src/org/zoap/xml/meta/builtin/IntegerElement.java
Index: IntegerElement.java
===================================================================
RCS file:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/IntegerElement.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- IntegerElement.java 2000/12/04 12:36:38 1.2
+++ IntegerElement.java 2001/01/03 10:23:57 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: IntegerElement.java,v 1.2 2000/12/04 12:36:38 jung Exp $
+ * $Id: IntegerElement.java,v 1.3 2001/01/03 10:23:57 jung Exp $
* Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
@@ -51,7 +51,7 @@
* XML wrapper around java.lang.Boolean. Implemented as a singleton
* <br>
* @author $Author: jung $
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class IntegerElement extends PrimitiveElement {
@@ -59,8 +59,8 @@
/** constructor cannot be faked anymore */
private IntegerElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString()+"()");
setType(IntegerType.getIntegerType());
setAppearanceName("integer");
@@ -76,8 +76,8 @@
/** global access */
public static IntegerElement getIntegerElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(IntegerElement.class.toString()+".getIntegerElement()\n");
+ if(Environment.DEBUG_LEVEL>1)
+
Environment.CONSOLE.log(IntegerElement.class.toString()+".getIntegerElement()");
return integerElement;
}
@@ -86,6 +86,9 @@
/*
* $Log: IntegerElement.java,v $
+ * Revision 1.3 2001/01/03 10:23:57 jung
+ * exception redesign. Improved null-pointer treatment. coherent environment and
logging facilities.
+ *
* Revision 1.2 2000/12/04 12:36:38 jung
* adopted to latest jboss container,
*
1.3 +15 -6 zoap/src/org/zoap/xml/meta/builtin/LongElement.java
Index: LongElement.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/LongElement.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- LongElement.java 2000/12/04 12:36:38 1.2
+++ LongElement.java 2001/01/03 10:23:57 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: LongElement.java,v 1.2 2000/12/04 12:36:38 jung Exp $
+ * $Id: LongElement.java,v 1.3 2001/01/03 10:23:57 jung Exp $
* Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
@@ -52,7 +52,7 @@
* XML wrapper around java.lang.long. Implemented as a singleton
* <br>
* @author $Author: jung $
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class LongElement extends PrimitiveElement {
@@ -60,8 +60,8 @@
/** constructor cannot be faked anymore */
private LongElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString()+"()");
setType(LongType.getLongType());
setAppearanceName("long");
@@ -77,8 +77,8 @@
/** global access */
public static LongElement getLongElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(LongElement.class.toString()+".getLongElement()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(LongElement.class.toString()+".getLongElement()");
return longElement;
}
@@ -88,6 +88,9 @@
/*
* $Log: LongElement.java,v $
+ * Revision 1.3 2001/01/03 10:23:57 jung
+ * exception redesign. Improved null-pointer treatment. coherent environment and
logging facilities.
+ *
* Revision 1.2 2000/12/04 12:36:38 jung
* adopted to latest jboss container,
*
1.3 +18 -9 zoap/src/org/zoap/xml/meta/builtin/NameAttribute.java
Index: NameAttribute.java
===================================================================
RCS file:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/NameAttribute.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NameAttribute.java 2000/12/04 12:36:38 1.2
+++ NameAttribute.java 2001/01/03 10:23:57 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: NameAttribute.java,v 1.2 2000/12/04 12:36:38 jung Exp $
+ * $Id: NameAttribute.java,v 1.3 2001/01/03 10:23:57 jung Exp $
* Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
@@ -59,8 +59,8 @@
private NameAttribute() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString()+"()");
setAppearanceSchema(ZoapSchema.getZoapSchema());
setAppearanceName("name");
@@ -69,8 +69,8 @@
public Object getAttributeContent(Object object, boolean isNew, Properties
references) {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(toString()+".getAttributeContent("+object+","+isNew+","+references+")\n");
+ if(Environment.DEBUG_LEVEL>1)
+
Environment.CONSOLE.log(toString()+".getAttributeContent("+object+","+isNew+","+references+")");
if(isNew && references!=null )
return references.get("XmlObjectWriter");
@@ -80,8 +80,8 @@
public Object setAttributeContent(Object object, Object value, Map references,
Map nameSpaces) {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(toString()+".setAttributeContent("+object+","+value+","+references+")\n");
+ if(Environment.DEBUG_LEVEL>1)
+
Environment.CONSOLE.log(toString()+".setAttributeContent("+object+","+value+","+references+")");
if(references.containsKey(value))
return references.get(value);
@@ -98,8 +98,8 @@
public static NameAttribute getNameAttribute() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(NameAttribute.class.toString()+".getNameAttribute()\n");
+ if(Environment.DEBUG_LEVEL>1)
+
Environment.CONSOLE.log(NameAttribute.class.toString()+".getNameAttribute()");
return nameAttribute;
}
@@ -108,6 +108,9 @@
/*
* $Log: NameAttribute.java,v $
+ * Revision 1.3 2001/01/03 10:23:57 jung
+ * exception redesign. Improved null-pointer treatment. coherent environment and
logging facilities.
+ *
* Revision 1.2 2000/12/04 12:36:38 jung
* adopted to latest jboss container,
*
1.3 +18 -9 zoap/src/org/zoap/xml/meta/builtin/RefAttribute.java
Index: RefAttribute.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/RefAttribute.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RefAttribute.java 2000/12/04 12:36:39 1.2
+++ RefAttribute.java 2001/01/03 10:23:57 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: RefAttribute.java,v 1.2 2000/12/04 12:36:39 jung Exp $
+ * $Id: RefAttribute.java,v 1.3 2001/01/03 10:23:57 jung Exp $
* Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
@@ -59,8 +59,8 @@
/** constructor */
private RefAttribute() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString()+"()");
setAppearanceSchema(ZoapSchema.getZoapSchema());
setAppearanceName("ref");
@@ -69,8 +69,8 @@
public Object getAttributeContent(Object object, boolean isNew, Properties
references) {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(toString()+".getAttributeContent("+object+","+isNew+","+references+")\n");
+ if(Environment.DEBUG_LEVEL>1)
+
Environment.CONSOLE.log(toString()+".getAttributeContent("+object+","+isNew+","+references+")");
if(!isNew && references!=null)
return references.get("XmlObjectWriter");
@@ -80,8 +80,8 @@
public Object setAttributeContent(Object object, Object value, Map references,
Map nameSpaces) {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(toString()+".setAttributeContent("+object+","+value+","+references+")\n");
+ if(Environment.DEBUG_LEVEL>1)
+
Environment.CONSOLE.log(toString()+".setAttributeContent("+object+","+value+","+references+")");
if(references.containsKey(value))
return references.get(value);
@@ -98,8 +98,8 @@
public static RefAttribute getRefAttribute() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(RefAttribute.class.toString()+".getRefAttribute()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(RefAttribute.class.toString()+".getRefAttribute()");
return refAttribute;
}
@@ -107,6 +107,9 @@
/*
* $Log: RefAttribute.java,v $
+ * Revision 1.3 2001/01/03 10:23:57 jung
+ * exception redesign. Improved null-pointer treatment. coherent environment and
logging facilities.
+ *
* Revision 1.2 2000/12/04 12:36:39 jung
* adopted to latest jboss container,
*
1.3 +15 -6 zoap/src/org/zoap/xml/meta/builtin/ShortElement.java
Index: ShortElement.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/ShortElement.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ShortElement.java 2000/12/04 12:36:39 1.2
+++ ShortElement.java 2001/01/03 10:23:57 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: ShortElement.java,v 1.2 2000/12/04 12:36:39 jung Exp $
+ * $Id: ShortElement.java,v 1.3 2001/01/03 10:23:57 jung Exp $
* Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
@@ -52,7 +52,7 @@
* XML wrapper around java.lang.Short. Implemented as a singleton
* <br>
* @author $Author: jung $
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class ShortElement extends PrimitiveElement {
@@ -60,8 +60,8 @@
/** constructor cannot be faked anymore */
private ShortElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString()+"()");
setType(ShortType.getShortType());
setAppearanceName("short");
@@ -77,8 +77,8 @@
/** global access */
public static ShortElement getShortElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(ShortElement.class.toString()+".getShortElement()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(ShortElement.class.toString()+".getShortElement()");
return shortElement;
}
@@ -88,6 +88,9 @@
/*
* $Log: ShortElement.java,v $
+ * Revision 1.3 2001/01/03 10:23:57 jung
+ * exception redesign. Improved null-pointer treatment. coherent environment and
logging facilities.
+ *
* Revision 1.2 2000/12/04 12:36:39 jung
* adopted to latest jboss container,
*
1.3 +15 -6 zoap/src/org/zoap/xml/meta/builtin/StringElement.java
Index: StringElement.java
===================================================================
RCS file:
/products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/StringElement.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- StringElement.java 2000/12/04 12:36:39 1.2
+++ StringElement.java 2001/01/03 10:23:57 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: StringElement.java,v 1.2 2000/12/04 12:36:39 jung Exp $
+ * $Id: StringElement.java,v 1.3 2001/01/03 10:23:57 jung Exp $
* Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
@@ -52,7 +52,7 @@
* XML wrapper around java.lang.String. Implemented as a singleton
* <br>
* @author $Author: jung $
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class StringElement extends PrimitiveElement {
@@ -60,8 +60,8 @@
/** constructor cannot be faked anymore */
private StringElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString()+"()");
setType(StringType.getStringType());
setAppearanceName("string");
@@ -77,8 +77,8 @@
/** global access */
public static StringElement getStringElement() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(StringElement.class.toString()+".getStringElement()\n");
+ if(Environment.DEBUG_LEVEL>1)
+
Environment.CONSOLE.log(StringElement.class.toString()+".getStringElement()");
return stringElement;
}
@@ -88,6 +88,9 @@
/*
* $Log: StringElement.java,v $
+ * Revision 1.3 2001/01/03 10:23:57 jung
+ * exception redesign. Improved null-pointer treatment. coherent environment and
logging facilities.
+ *
* Revision 1.2 2000/12/04 12:36:39 jung
* adopted to latest jboss container,
*
1.3 +3 -3 zoap/src/org/zoap/xml/meta/builtin/ZoapSchema.java
Index: ZoapSchema.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/meta/builtin/ZoapSchema.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ZoapSchema.java 2000/12/04 12:36:39 1.2
+++ ZoapSchema.java 2001/01/03 10:23:58 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: ZoapSchema.java,v 1.2 2000/12/04 12:36:39 jung Exp $
+ * $Id: ZoapSchema.java,v 1.3 2001/01/03 10:23:58 jung Exp $
* Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
@@ -66,8 +66,8 @@
private ZoapSchema() {
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
+ if(Environment.DEBUG_LEVEL>1)
+ Environment.CONSOLE.log(toString()+"()");
setUrn(Environment.INTERNAL_URN);