You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2016/09/05 14:26:05 UTC
incubator-juneau git commit: Replace @Xml(name=) with @Bean(name=)
Repository: incubator-juneau
Updated Branches:
refs/heads/master d408947b1 -> a28225229
Replace @Xml(name=) with @Bean(name=)
Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau/commit/a2822522
Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau/tree/a2822522
Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau/diff/a2822522
Branch: refs/heads/master
Commit: a282252299f60c7e0793211695b2667816df0e69
Parents: d408947
Author: jamesbognar <ja...@gmail.com>
Authored: Mon Sep 5 10:25:52 2016 -0400
Committer: jamesbognar <ja...@gmail.com>
Committed: Mon Sep 5 10:25:52 2016 -0400
----------------------------------------------------------------------
.../main/java/org/apache/juneau/ClassMeta.java | 66 +++++++++++++-------
.../org/apache/juneau/dto/atom/Category.java | 5 +-
.../java/org/apache/juneau/dto/atom/Entry.java | 3 +-
.../java/org/apache/juneau/dto/atom/Feed.java | 2 +-
.../org/apache/juneau/dto/atom/Generator.java | 5 +-
.../java/org/apache/juneau/dto/atom/Icon.java | 5 +-
.../java/org/apache/juneau/dto/atom/Id.java | 5 +-
.../java/org/apache/juneau/dto/atom/Link.java | 5 +-
.../java/org/apache/juneau/dto/atom/Logo.java | 5 +-
.../org/apache/juneau/dto/cognos/Column.java | 5 +-
.../org/apache/juneau/dto/cognos/DataSet.java | 8 +--
.../apache/juneau/dto/jsonschema/Schema.java | 7 +--
.../org/apache/juneau/json/JsonSerializer.java | 2 +-
.../apache/juneau/xml/XmlBeanPropertyMeta.java | 8 +--
.../org/apache/juneau/xml/XmlClassMeta.java | 14 +----
.../apache/juneau/xml/XmlSchemaSerializer.java | 8 +--
.../org/apache/juneau/xml/XmlSerializer.java | 8 +--
.../org/apache/juneau/xml/annotation/Xml.java | 37 +----------
.../org/apache/juneau/xml/XmlCollapsedTest.java | 2 +-
.../org/apache/juneau/xml/XmlContentTest.java | 7 ++-
.../java/org/apache/juneau/xml/XmlTest.java | 41 +++---------
.../java/org/apache/juneau/xml/xml1a/T2.java | 6 +-
.../java/org/apache/juneau/xml/xml1b/T4.java | 5 +-
.../java/org/apache/juneau/xml/xml1b/T5.java | 6 +-
.../juneau/samples/addressbook/Address.java | 4 +-
.../juneau/samples/addressbook/AddressBook.java | 6 +-
.../samples/addressbook/CreateAddress.java | 4 +-
.../samples/addressbook/CreatePerson.java | 3 +-
.../juneau/samples/addressbook/Person.java | 3 +-
29 files changed, 121 insertions(+), 164 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/ClassMeta.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/ClassMeta.java b/juneau-core/src/main/java/org/apache/juneau/ClassMeta.java
index 18d0c8d..2b7ce15 100644
--- a/juneau-core/src/main/java/org/apache/juneau/ClassMeta.java
+++ b/juneau-core/src/main/java/org/apache/juneau/ClassMeta.java
@@ -2,7 +2,7 @@
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
+// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
@@ -59,10 +59,10 @@ public final class ClassMeta<T> implements Type {
ClassCategory classCategory = UNKNOWN; // The class category.
final Class<T> innerClass; // The class being wrapped.
ClassMeta<?>
- serializedClassMeta, // The transformed class type (if class has swap associated with it).
- elementType = null, // If ARRAY or COLLECTION, the element class type.
- keyType = null, // If MAP, the key class type.
- valueType = null; // If MAP, the value class type.
+ serializedClassMeta, // The transformed class type (if class has swap associated with it).
+ elementType = null, // If ARRAY or COLLECTION, the element class type.
+ keyType = null, // If MAP, the key class type.
+ valueType = null; // If MAP, the value class type.
InvocationHandler invocationHandler; // The invocation handler for this class (if it has one).
volatile BeanMeta<T> beanMeta; // The bean meta for this bean class (if it's a bean).
Method fromStringMethod; // The static valueOf(String) or fromString(String) method (if it has one).
@@ -78,17 +78,18 @@ public final class ClassMeta<T> implements Type {
PojoSwap<T,?> pojoSwap; // The object POJO swap associated with this bean (if it has one).
BeanFilter<? extends T> beanFilter; // The bean filter associated with this bean (if it has one).
boolean
- isDelegate, // True if this class extends Delegate.
- isAbstract, // True if this class is abstract.
- isMemberClass; // True if this is a non-static member class.
+ isDelegate, // True if this class extends Delegate.
+ isAbstract, // True if this class is abstract.
+ isMemberClass; // True if this is a non-static member class.
private MetadataMap extMeta = new MetadataMap(); // Extended metadata
- private ClassLexicon classLexicon;
+ private ClassLexicon classLexicon; // The class lexicon defined on this bean or pojo.
+ private String name; // The lexical name associated with this bean or pojo.
- private Throwable initException; // Any exceptions thrown in the init() method.
- private boolean hasChildPojoSwaps; // True if this class or any subclass of this class has a PojoSwap associated with it.
- private Object primitiveDefault; // Default value for primitive type classes.
- private Map<String,Method> remoteableMethods, // Methods annotated with @Remoteable. Contains all public methods if class is annotated with @Remotable.
+ private Throwable initException; // Any exceptions thrown in the init() method.
+ private boolean hasChildPojoSwaps; // True if this class or any subclass of this class has a PojoSwap associated with it.
+ private Object primitiveDefault; // Default value for primitive type classes.
+ private Map<String,Method> remoteableMethods, // Methods annotated with @Remoteable. Contains all public methods if class is annotated with @Remotable.
publicMethods; // All public methods, including static methods.
private static final Boolean BOOLEAN_DEFAULT = false;
@@ -131,12 +132,18 @@ public final class ClassMeta<T> implements Type {
pojoSwap = findPojoSwap(beanContext);
classLexicon = beanContext.getClassLexicon();
- for (Pojo p : ReflectionUtils.findAnnotationsParentFirst(Pojo.class, innerClass))
+ for (Pojo p : ReflectionUtils.findAnnotationsParentFirst(Pojo.class, innerClass)) {
if (p.classLexicon().length > 0)
classLexicon = new ClassLexicon(p.classLexicon());
- for (Bean b : ReflectionUtils.findAnnotationsParentFirst(Bean.class, innerClass))
+ if (! p.name().isEmpty())
+ name = p.name();
+ }
+ for (Bean b : ReflectionUtils.findAnnotationsParentFirst(Bean.class, innerClass)) {
if (b.classLexicon().length > 0)
classLexicon = new ClassLexicon(b.classLexicon());
+ if (! b.name().isEmpty())
+ name = b.name();
+ }
serializedClassMeta = (pojoSwap == null ? this : beanContext.getClassMeta(pojoSwap.getSwapClass()));
if (serializedClassMeta == null)
@@ -399,6 +406,17 @@ public final class ClassMeta<T> implements Type {
}
/**
+ * Returns the lexical name associated with this class.
+ * <p>
+ * The lexical name is defined by either {@link Bean#name()} or {@link Pojo#name()}.
+ *
+ * @return The lexical name associated with this class, or <jk>null</jk> if there is no lexical name defined.
+ */
+ public String getLexiconName() {
+ return name;
+ }
+
+ /**
* Returns the category of this class.
*
* @return The category of this class.
@@ -1255,29 +1273,29 @@ public final class ClassMeta<T> implements Type {
* @return The same string builder passed in (for method chaining).
*/
protected StringBuilder toString(StringBuilder sb, boolean simple) {
- String name = innerClass.getName();
+ String n = innerClass.getName();
if (simple) {
- int i = name.lastIndexOf('.');
- name = name.substring(i == -1 ? 0 : i+1).replace('$', '.');
+ int i = n.lastIndexOf('.');
+ n = n.substring(i == -1 ? 0 : i+1).replace('$', '.');
}
switch(classCategory) {
case ARRAY:
return elementType.toString(sb, simple).append('[').append(']');
case MAP:
- return sb.append(name).append(keyType.isObject() && valueType.isObject() ? "" : "<"+keyType.toString(simple)+","+valueType.toString(simple)+">");
+ return sb.append(n).append(keyType.isObject() && valueType.isObject() ? "" : "<"+keyType.toString(simple)+","+valueType.toString(simple)+">");
case BEANMAP:
- return sb.append(BeanMap.class.getName()).append('<').append(name).append('>');
+ return sb.append(BeanMap.class.getName()).append('<').append(n).append('>');
case COLLECTION:
- return sb.append(name).append(elementType.isObject() ? "" : "<"+elementType.toString(simple)+">");
+ return sb.append(n).append(elementType.isObject() ? "" : "<"+elementType.toString(simple)+">");
case OTHER:
if (simple)
- return sb.append(name);
- sb.append("OTHER-").append(name).append(",notABeanReason=").append(notABeanReason);
+ return sb.append(n);
+ sb.append("OTHER-").append(n).append(",notABeanReason=").append(notABeanReason);
if (initException != null)
sb.append(",initException=").append(initException);
return sb;
default:
- return sb.append(name);
+ return sb.append(n);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/dto/atom/Category.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Category.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Category.java
index 0807ba4..0f6cbdb 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Category.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Category.java
@@ -14,8 +14,9 @@ package org.apache.juneau.dto.atom;
import static org.apache.juneau.xml.annotation.XmlFormat.*;
-import java.net.*;
+import java.net.URI;
+import org.apache.juneau.annotation.*;
import org.apache.juneau.xml.annotation.*;
/**
@@ -38,7 +39,7 @@ import org.apache.juneau.xml.annotation.*;
*
* @author James Bognar (james.bognar@salesforce.com)
*/
-@Xml(name="category")
+@Bean(name="category")
public class Category extends Common {
private String term;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/dto/atom/Entry.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Entry.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Entry.java
index 42d04c7..051d449 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Entry.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Entry.java
@@ -17,7 +17,6 @@ import java.util.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.transforms.*;
-import org.apache.juneau.xml.annotation.*;
/**
* Represents an <code>atomEntry</code> construct in the RFC4287 specification.
@@ -48,7 +47,7 @@ import org.apache.juneau.xml.annotation.*;
*
* @author James Bognar (james.bognar@salesforce.com)
*/
-@Xml(name="entry")
+@Bean(name="entry")
public class Entry extends CommonEntry {
private Content content;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/dto/atom/Feed.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Feed.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Feed.java
index 08e8554..a12c8d8 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Feed.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Feed.java
@@ -52,7 +52,7 @@ import org.apache.juneau.xml.annotation.*;
*
* @author James Bognar (james.bognar@salesforce.com)
*/
-@Xml(name="feed")
+@Bean(name="feed")
@SuppressWarnings("hiding")
public class Feed extends CommonEntry {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/dto/atom/Generator.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Generator.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Generator.java
index 037ec01..65be218 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Generator.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Generator.java
@@ -14,8 +14,9 @@ package org.apache.juneau.dto.atom;
import static org.apache.juneau.xml.annotation.XmlFormat.*;
-import java.net.*;
+import java.net.URI;
+import org.apache.juneau.annotation.*;
import org.apache.juneau.xml.annotation.*;
/**
@@ -36,7 +37,7 @@ import org.apache.juneau.xml.annotation.*;
*
* @author James Bognar (james.bognar@salesforce.com)
*/
-@Xml(name="generator")
+@Bean(name="generator")
public class Generator extends Common {
private URI uri;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/dto/atom/Icon.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Icon.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Icon.java
index 0bbe2f8..4736728 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Icon.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Icon.java
@@ -14,8 +14,9 @@ package org.apache.juneau.dto.atom;
import static org.apache.juneau.xml.annotation.XmlFormat.*;
-import java.net.*;
+import java.net.URI;
+import org.apache.juneau.annotation.*;
import org.apache.juneau.xml.annotation.*;
/**
@@ -34,7 +35,7 @@ import org.apache.juneau.xml.annotation.*;
*
* @author James Bognar (james.bognar@salesforce.com)
*/
-@Xml(name="icon")
+@Bean(name="icon")
public class Icon extends Common {
private URI uri;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/dto/atom/Id.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Id.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Id.java
index 3cfd9a5..54950cf 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Id.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Id.java
@@ -14,8 +14,9 @@ package org.apache.juneau.dto.atom;
import static org.apache.juneau.xml.annotation.XmlFormat.*;
-import java.net.*;
+import java.net.URI;
+import org.apache.juneau.annotation.*;
import org.apache.juneau.xml.annotation.*;
/**
@@ -34,7 +35,7 @@ import org.apache.juneau.xml.annotation.*;
*
* @author James Bognar (james.bognar@salesforce.com)
*/
-@Xml(name="id")
+@Bean(name="id")
public class Id extends Common {
private String text;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/dto/atom/Link.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Link.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Link.java
index 8076cd5..45d8e9f 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Link.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Link.java
@@ -14,8 +14,9 @@ package org.apache.juneau.dto.atom;
import static org.apache.juneau.xml.annotation.XmlFormat.*;
-import java.net.*;
+import java.net.URI;
+import org.apache.juneau.annotation.*;
import org.apache.juneau.xml.annotation.*;
/**
@@ -41,7 +42,7 @@ import org.apache.juneau.xml.annotation.*;
*
* @author James Bognar (james.bognar@salesforce.com)
*/
-@Xml(name="link")
+@Bean(name="link")
public class Link extends Common {
private String href;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/dto/atom/Logo.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Logo.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Logo.java
index 6258bcd..2866d53 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Logo.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Logo.java
@@ -14,8 +14,9 @@ package org.apache.juneau.dto.atom;
import static org.apache.juneau.xml.annotation.XmlFormat.*;
-import java.net.*;
+import java.net.URI;
+import org.apache.juneau.annotation.*;
import org.apache.juneau.xml.annotation.*;
/**
@@ -34,7 +35,7 @@ import org.apache.juneau.xml.annotation.*;
*
* @author James Bognar (james.bognar@salesforce.com)
*/
-@Xml(name="logo")
+@Bean(name="logo")
public class Logo extends Common {
private URI uri;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/dto/cognos/Column.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/cognos/Column.java b/juneau-core/src/main/java/org/apache/juneau/dto/cognos/Column.java
index d43b886..2b8802b 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/cognos/Column.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/cognos/Column.java
@@ -2,7 +2,7 @@
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
+// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
@@ -26,9 +26,8 @@ import org.apache.juneau.xml.annotation.*;
*
* @author James Bognar (james.bognar@salesforce.com)
*/
-@Xml(name="item")
@SuppressWarnings({"rawtypes","hiding"})
-@Bean(properties={"name","type","length"})
+@Bean(name="item",properties={"name","type","length"})
public class Column {
private String name, type;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/dto/cognos/DataSet.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/cognos/DataSet.java b/juneau-core/src/main/java/org/apache/juneau/dto/cognos/DataSet.java
index 1351b4a..6932e58 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/cognos/DataSet.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/cognos/DataSet.java
@@ -2,7 +2,7 @@
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
+// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
@@ -74,9 +74,8 @@ import org.apache.juneau.xml.annotation.*;
*
* @author James Bognar (james.bognar@salesforce.com)
*/
-@Xml(name="dataset")
@SuppressWarnings("unchecked")
-@Bean(properties={"metadata","data"})
+@Bean(name="dataset", properties={"metadata","data"})
public class DataSet {
private Column[] metaData;
@@ -137,7 +136,8 @@ public class DataSet {
*
* @author James Bognar (james.bognar@salesforce.com)
*/
- @Xml(name="row", childName="value")
+ @Bean(name="row")
+ @Xml(childName="value")
public static class Row extends LinkedList<String> {
private static final long serialVersionUID = 1L;
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/Schema.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/Schema.java b/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/Schema.java
index 6a8f52b..f135bc3 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/Schema.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/jsonschema/Schema.java
@@ -2,7 +2,7 @@
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
+// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
@@ -20,7 +20,6 @@ import org.apache.juneau.annotation.*;
import org.apache.juneau.parser.*;
import org.apache.juneau.serializer.*;
import org.apache.juneau.transform.*;
-import org.apache.juneau.xml.annotation.*;
/**
* Represents a top-level schema object bean in the JSON-Schema core specification.
@@ -29,9 +28,9 @@ import org.apache.juneau.xml.annotation.*;
*
* @author James Bognar (james.bognar@salesforce.com)
*/
-@Xml(name="schema")
@SuppressWarnings("hiding")
-@Bean(properties={"id","$schema","$ref", "title","description","type","definitions","properties",
+@Bean(name="schema",
+ properties={"id","$schema","$ref", "title","description","type","definitions","properties",
"patternProperties","dependencies","items","multipleOf","maximum","exclusiveMaximum",
"minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems",
"maxItems","minItems","uniqueItems","maxProperties","minProperties","required",
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/json/JsonSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/json/JsonSerializer.java b/juneau-core/src/main/java/org/apache/juneau/json/JsonSerializer.java
index bd0ce09..cb5297a 100644
--- a/juneau-core/src/main/java/org/apache/juneau/json/JsonSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/json/JsonSerializer.java
@@ -2,7 +2,7 @@
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
+// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/xml/XmlBeanPropertyMeta.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlBeanPropertyMeta.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlBeanPropertyMeta.java
index 8512b8c..5a32382 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlBeanPropertyMeta.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlBeanPropertyMeta.java
@@ -2,7 +2,7 @@
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
+// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
@@ -105,8 +105,6 @@ public class XmlBeanPropertyMeta extends BeanPropertyMetaExtended {
ClassMeta<?> cmProperty = bpm.getClassMeta();
ClassMeta<?> cmBean = bpm.getBeanMeta().getClassMeta();
String name = bpm.getName();
- if (! xml.name().isEmpty())
- throw new BeanRuntimeException(cmBean.getInnerClass(), "Annotation error on property ''{0}''. Found @Xml.name annotation can only be specified on types.", name);
List<Xml> xmls = bpm.findAnnotations(Xml.class);
List<XmlSchema> schemas = bpm.findAnnotations(XmlSchema.class);
@@ -126,14 +124,14 @@ public class XmlBeanPropertyMeta extends BeanPropertyMetaExtended {
if (cen.isEmpty())
cen = cmProperty.getExtendedMeta(XmlClassMeta.class).getChildName();
if (cen == null || cen.isEmpty())
- cen = cmProperty.getElementType().getExtendedMeta(XmlClassMeta.class).getElementName();
+ cen = cmProperty.getElementType().getLexiconName();
if (cen == null || cen.isEmpty())
cen = name;
} else {
throw new BeanRuntimeException(cmBean.getInnerClass(), "Annotation error on property ''{0}''. @Xml.format=COLLAPSED can only be specified on collections and arrays.", name);
}
if (cen.isEmpty() && isCollection)
- cen = cmProperty.getExtendedMeta(XmlClassMeta.class).getElementName();
+ cen = cmProperty.getLexiconName();
}
try {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/xml/XmlClassMeta.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlClassMeta.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlClassMeta.java
index d89355a..24367fb 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlClassMeta.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlClassMeta.java
@@ -2,7 +2,7 @@
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
+// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
@@ -28,7 +28,6 @@ public class XmlClassMeta extends ClassMetaExtended {
private final Namespace namespace;
private final Xml xml;
private final XmlFormat format;
- private final String elementName;
private final String childName;
/**
@@ -43,12 +42,10 @@ public class XmlClassMeta extends ClassMetaExtended {
this.xml = ReflectionUtils.getAnnotation(Xml.class, c);
if (xml != null) {
this.format = xml.format();
- this.elementName = StringUtils.nullIfEmpty(xml.name());
this.childName = StringUtils.nullIfEmpty(xml.childName());
} else {
this.format = XmlFormat.NORMAL;
- this.elementName = null;
this.childName = null;
}
}
@@ -72,15 +69,6 @@ public class XmlClassMeta extends ClassMetaExtended {
}
/**
- * Returns the {@link Xml#name()} annotation defined on the class.
- *
- * @return The value of the {@link Xml#name()} annotation, or <jk>null</jk> if not specified.
- */
- protected String getElementName() {
- return elementName;
- }
-
- /**
* Returns the {@link Xml#childName()} annotation defined on the class.
*
* @return The value of the {@link Xml#childName()} annotation, or <jk>null</jk> if not specified.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
index 0673d12..8e64065 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
@@ -2,7 +2,7 @@
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
+// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
@@ -197,9 +197,9 @@ public class XmlSchemaSerializer extends XmlSerializer {
queueElement(ns, "null", object());
else {
XmlClassMeta xmlMeta = cm.getExtendedMeta(XmlClassMeta.class);
- if (xmlMeta.getElementName() != null && xmlMeta.getNamespace() != null)
+ if (cm.getLexiconName() != null && xmlMeta.getNamespace() != null)
ns = xmlMeta.getNamespace();
- queueElement(ns, xmlMeta.getElementName(), cm);
+ queueElement(ns, cm.getLexiconName(), cm);
}
processQueue();
}
@@ -521,7 +521,7 @@ public class XmlSchemaSerializer extends XmlSerializer {
private String getElementName(ClassMeta<?> cm) {
cm = cm.getSerializedClassMeta();
- String name = cm.getExtendedMeta(XmlClassMeta.class).getElementName();
+ String name = cm.getLexiconName();
if (name == null) {
if (cm.isBoolean())
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java
index a926e2d..7ceac46 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSerializer.java
@@ -2,7 +2,7 @@
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
+// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
@@ -375,9 +375,9 @@ public class XmlSerializer extends WriterSerializer {
// Is there a name associated with this bean?
if (elementName == null)
- elementName = gType.getExtendedMeta(XmlClassMeta.class).getElementName();
+ elementName = gType.getLexiconName();
if (elementName == null)
- elementName = aType.getExtendedMeta(XmlClassMeta.class).getElementName();
+ elementName = aType.getLexiconName();
// If the value is null then it's either going to be <null/> or <XmlSerializer nil='true'/>
// depending on whether the element has a name.
@@ -621,7 +621,7 @@ public class XmlSerializer extends WriterSerializer {
}
if (eName == null && ! elementType.isObject()) {
- eName = elementType.getExtendedMeta(XmlClassMeta.class).getElementName();
+ eName = elementType.getLexiconName();
eNs = elementType.getExtendedMeta(XmlClassMeta.class).getNamespace();
}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/main/java/org/apache/juneau/xml/annotation/Xml.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/annotation/Xml.java b/juneau-core/src/main/java/org/apache/juneau/xml/annotation/Xml.java
index baf558d..1589758 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/annotation/Xml.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/annotation/Xml.java
@@ -2,7 +2,7 @@
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
+// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
@@ -41,41 +41,6 @@ import org.apache.juneau.xml.*;
public @interface Xml {
/**
- * Sets the name of the XML element in cases where the XML element has no name (e.g. the root element).
- * <p>
- * Applies only to {@link ElementType#TYPE}.
- *
- * <dl>
- * <dt>Example:</dt>
- * <dd>
- * <p class='bcode'>
- * <ja>@Xml</ja>(name=<js>"MyBean"</js>)
- * <jk>public class</jk> MyBean {
- * <jk>public int</jk> f1 = 123;
- * }
- * </p>
- * <p>
- * Without the <ja>@Xml</ja> annotations, serializing this bean as XML would have produced the following...
- * </p>
- * <p class='bcode'>
- * <xt><object></xt>
- * <xt><f1></xt>123<xt></f1></xt>
- * <xt></object></xt>
- * </p>
- * <p>
- * With the annotations, serializing this bean as XML produces the following...
- * </p>
- * <p class='bcode'>
- * <xt><MyBean></xt>
- * <xt><f1></xt>123<xt></f1></xt>
- * <xt></MyBean></xt>
- * </p>
- * </dd>
- * </dl>
- */
- String name() default "";
-
- /**
* Sets the name of the XML child elements for bean properties of type collection and array.
* <p>
* Applies only to collection and array bean properties.
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/test/java/org/apache/juneau/xml/XmlCollapsedTest.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/test/java/org/apache/juneau/xml/XmlCollapsedTest.java b/juneau-core/src/test/java/org/apache/juneau/xml/XmlCollapsedTest.java
index 8d63791..7920eda 100755
--- a/juneau-core/src/test/java/org/apache/juneau/xml/XmlCollapsedTest.java
+++ b/juneau-core/src/test/java/org/apache/juneau/xml/XmlCollapsedTest.java
@@ -335,7 +335,7 @@ public class XmlCollapsedTest {
}
}
- @Xml(name="xf1")
+ @Bean(name="xf1")
public static class F1 {
@Xml(format=CONTENT)
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/test/java/org/apache/juneau/xml/XmlContentTest.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/test/java/org/apache/juneau/xml/XmlContentTest.java b/juneau-core/src/test/java/org/apache/juneau/xml/XmlContentTest.java
index 114d447..9f5e9c7 100755
--- a/juneau-core/src/test/java/org/apache/juneau/xml/XmlContentTest.java
+++ b/juneau-core/src/test/java/org/apache/juneau/xml/XmlContentTest.java
@@ -2,7 +2,7 @@
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
+// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
@@ -24,6 +24,7 @@ import java.io.*;
import javax.xml.stream.*;
import org.apache.juneau.*;
+import org.apache.juneau.annotation.*;
import org.apache.juneau.xml.annotation.*;
import org.junit.*;
@@ -125,7 +126,7 @@ public class XmlContentTest {
assertEqualObjects(t, t2);
}
- @Xml(name="A")
+ @Bean(name="A")
public static class A {
@Xml(format=ATTR) public String f1;
@Xml(format=CONTENT) public String f2;
@@ -248,7 +249,7 @@ public class XmlContentTest {
assertEqualObjects(t, t2);
}
- @Xml(name="A")
+ @Bean(name="A")
public static class B {
@Xml(format=ATTR) public String f1;
@Xml(format=CONTENT, contentHandler=BContentHandler.class) public String f2;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/test/java/org/apache/juneau/xml/XmlTest.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/test/java/org/apache/juneau/xml/XmlTest.java b/juneau-core/src/test/java/org/apache/juneau/xml/XmlTest.java
index 2ff059c..b18d83d 100755
--- a/juneau-core/src/test/java/org/apache/juneau/xml/XmlTest.java
+++ b/juneau-core/src/test/java/org/apache/juneau/xml/XmlTest.java
@@ -2,7 +2,7 @@
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
+// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
@@ -82,8 +82,7 @@ public class XmlTest {
}
/** Class with explicitly specified properties */
- @Bean(properties = { "name", "age" })
- @Xml(name="Person1")
+ @Bean(name="Person1", properties = { "name", "age" })
public static class Person1 {
public int age;
private String name;
@@ -124,7 +123,7 @@ public class XmlTest {
validateXml(t);
}
- @Xml(name="foo")
+ @Bean(name="foo")
public static class A {
public int f1 = 1;
}
@@ -156,7 +155,7 @@ public class XmlTest {
validateXml(t);
}
- @Xml(name="foo")
+ @Bean(name="foo")
public static interface C1 {}
public static class C2 implements C1 {}
public static class C3 extends C2 {
@@ -177,32 +176,12 @@ public class XmlTest {
validateXml(t);
}
- @Xml(name="~!@#$%^&*()_+`-={}|[]\\:\";'<>?,.\n\r\t\b")
+ @Bean(name="~!@#$%^&*()_+`-={}|[]\\:\";'<>?,.\n\r\t\b")
public static class D {
public int f1 = 1;
}
//====================================================================================================
- // Element name can only be specified on classes.
- //====================================================================================================
- @Test
- public void testElementNameInInvalidLocations() throws Exception {
- XmlSerializer s = XmlSerializer.DEFAULT_SIMPLE_SQ;
- E t = new E();
- try {
- s.serialize(t);
- fail("Exception not thrown");
- } catch (Exception e) {
- assertEquals("org.apache.juneau.xml.XmlTest$E: Annotation error on property 'f1'. Found @Xml.name annotation can only be specified on types.", e.getLocalizedMessage());
- }
- }
-
- public static class E {
- @Xml(name="foo")
- public int f1 = 1;
- }
-
- //====================================================================================================
// Element name on collection.
//====================================================================================================
@Test
@@ -218,7 +197,7 @@ public class XmlTest {
validateXml(t);
}
- @Xml(name="foo")
+ @Bean(name="foo")
public static class F extends LinkedList<String>{}
//====================================================================================================
@@ -237,7 +216,7 @@ public class XmlTest {
validateXml(t);
}
- @Xml(name="bar")
+ @Bean(name="bar")
public static class G {
public F f1 = new F();
}
@@ -253,7 +232,7 @@ public class XmlTest {
assertEquals("<foo>bar</foo>", r);
}
- @Xml(name="foo")
+ @Pojo(name="foo")
public static class H {
@Override /* Object */
public String toString() {
@@ -292,13 +271,13 @@ public class XmlTest {
assertEquals("<foo><f1><bar><f2>2</f2></bar></f1></foo>", r);
}
- @Xml(name="foo")
+ @Bean(name="foo")
public static class J1 {
@BeanProperty(properties={"f2"}) public List<J2> f1 = new LinkedList<J2>() {{
add(new J2());
}};}
- @Xml(name="bar")
+ @Bean(name="bar")
public static class J2 {
public int f2 = 2;
public int f3 = 3;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/test/java/org/apache/juneau/xml/xml1a/T2.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/test/java/org/apache/juneau/xml/xml1a/T2.java b/juneau-core/src/test/java/org/apache/juneau/xml/xml1a/T2.java
index 068f9ce..793f295 100755
--- a/juneau-core/src/test/java/org/apache/juneau/xml/xml1a/T2.java
+++ b/juneau-core/src/test/java/org/apache/juneau/xml/xml1a/T2.java
@@ -2,7 +2,7 @@
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
+// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
@@ -15,8 +15,8 @@ package org.apache.juneau.xml.xml1a;
import org.apache.juneau.annotation.*;
import org.apache.juneau.xml.annotation.*;
-@Xml(prefix="foo",namespace="http://foo",name="T2")
-@Bean(sort=true)
+@Xml(prefix="foo",namespace="http://foo")
+@Bean(name="T2", sort=true)
@SuppressWarnings("javadoc")
public class T2 {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/test/java/org/apache/juneau/xml/xml1b/T4.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/test/java/org/apache/juneau/xml/xml1b/T4.java b/juneau-core/src/test/java/org/apache/juneau/xml/xml1b/T4.java
index 29548bb..799da39 100755
--- a/juneau-core/src/test/java/org/apache/juneau/xml/xml1b/T4.java
+++ b/juneau-core/src/test/java/org/apache/juneau/xml/xml1b/T4.java
@@ -2,7 +2,7 @@
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
+// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
@@ -15,8 +15,7 @@ package org.apache.juneau.xml.xml1b;
import org.apache.juneau.annotation.*;
import org.apache.juneau.xml.annotation.*;
-@Xml(name="T4")
-@Bean(sort=true)
+@Bean(name="T4", sort=true)
@SuppressWarnings("javadoc")
public class T4 {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-core/src/test/java/org/apache/juneau/xml/xml1b/T5.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/test/java/org/apache/juneau/xml/xml1b/T5.java b/juneau-core/src/test/java/org/apache/juneau/xml/xml1b/T5.java
index 20850aa..fa10cea 100755
--- a/juneau-core/src/test/java/org/apache/juneau/xml/xml1b/T5.java
+++ b/juneau-core/src/test/java/org/apache/juneau/xml/xml1b/T5.java
@@ -2,7 +2,7 @@
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
+// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
@@ -15,8 +15,8 @@ package org.apache.juneau.xml.xml1b;
import org.apache.juneau.annotation.*;
import org.apache.juneau.xml.annotation.*;
-@Xml(prefix="foo",namespace="http://foo",name="T5")
-@Bean(sort=true)
+@Xml(prefix="foo",namespace="http://foo")
+@Bean(name="T5", sort=true)
@SuppressWarnings("javadoc")
public class T5 {
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/Address.java
----------------------------------------------------------------------
diff --git a/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/Address.java b/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/Address.java
index 7ab0c8a..f3f309c 100755
--- a/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/Address.java
+++ b/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/Address.java
@@ -14,14 +14,16 @@ package org.apache.juneau.samples.addressbook;
import java.net.URI;
+import org.apache.juneau.annotation.*;
import org.apache.juneau.jena.annotation.*;
import org.apache.juneau.xml.annotation.*;
/**
* Address bean
*/
-@Xml(prefix="addr",name="address")
+@Xml(prefix="addr")
@Rdf(prefix="addr")
+@Bean(name="address")
public class Address {
private static int nextAddressId = 1;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/AddressBook.java
----------------------------------------------------------------------
diff --git a/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/AddressBook.java b/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/AddressBook.java
index 5dd9dc3..910b804 100755
--- a/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/AddressBook.java
+++ b/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/AddressBook.java
@@ -12,16 +12,16 @@
// ***************************************************************************************************************************
package org.apache.juneau.samples.addressbook;
-import java.net.*;
+import java.net.URI;
import java.text.*;
import java.util.*;
-import org.apache.juneau.xml.annotation.*;
+import org.apache.juneau.annotation.*;
/**
* Address book bean
*/
-@Xml(name="addressBook")
+@Bean(name="addressBook")
public class AddressBook extends LinkedList<Person> implements IAddressBook {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/CreateAddress.java
----------------------------------------------------------------------
diff --git a/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/CreateAddress.java b/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/CreateAddress.java
index 95c220b..fde34b9 100755
--- a/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/CreateAddress.java
+++ b/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/CreateAddress.java
@@ -12,14 +12,16 @@
// ***************************************************************************************************************************
package org.apache.juneau.samples.addressbook;
+import org.apache.juneau.annotation.*;
import org.apache.juneau.jena.annotation.*;
import org.apache.juneau.xml.annotation.*;
/**
* POJO for creating a new address
*/
-@Xml(prefix="addr",name="address")
+@Xml(prefix="addr")
@Rdf(prefix="addr")
+@Bean(name="address")
public class CreateAddress {
// Bean properties
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/CreatePerson.java
----------------------------------------------------------------------
diff --git a/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/CreatePerson.java b/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/CreatePerson.java
index 4617566..8a0f2fe 100755
--- a/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/CreatePerson.java
+++ b/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/CreatePerson.java
@@ -22,8 +22,9 @@ import org.apache.juneau.xml.annotation.*;
/**
* POJO for creating a new person
*/
-@Xml(prefix="per",name="person")
+@Xml(prefix="per")
@Rdf(prefix="per")
+@Bean(name="person")
public class CreatePerson {
// Bean properties
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a2822522/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/Person.java
----------------------------------------------------------------------
diff --git a/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/Person.java b/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/Person.java
index a38dca2..ee93242 100755
--- a/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/Person.java
+++ b/juneau-samples/src/main/java/org/apache/juneau/samples/addressbook/Person.java
@@ -23,8 +23,9 @@ import org.apache.juneau.xml.annotation.*;
/**
* Person POJO
*/
-@Xml(prefix="per",name="person")
+@Xml(prefix="per")
@Rdf(prefix="per")
+@Bean(name="person")
public class Person {
private static int nextPersonId = 1;