Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedByJoiningStrategy.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitMetadata.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitTransactionType.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseColumnAnnotation.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToManyAnnotation.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOneAnnotation.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToManyAnnotation.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOneAnnotation.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OwnableRelationshipMappingAnnotation.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java235
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Caching.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ChangeTracking.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ConversionValue.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Convert.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/CustomConverter.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Customizer.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConverter.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ExpiryTimeOfDay.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/JoinFetch.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ObjectTypeConverter.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/PrivateOwned.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/StructConverter.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/TypeConverter.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaCaching.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaConverterHolder.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/ConverterHolder.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/CacheProperties.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/CustomizerProperties.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ReadTransformerAnnotation.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/StructConverterAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/WriteTransformerAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/META-INF/MANIFEST.MF2
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/orm/details/EclipseLinkConverterStateObject.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF4
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal2/ORMGenCustomizer.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF1
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/BaseJpaPlatformUi.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManagerFactory.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Counter.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java217
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GenericIteratorWrapper.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GenericListIteratorWrapper.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/AbstractModel.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeAdapter.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/StateChangeAdapter.java31
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java6
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/connection/ConnectionAdapterTests.java2
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java63
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java25
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java3
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java6
67 files changed, 1082 insertions, 570 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedByJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedByJoiningStrategy.java
index a449844133..38f60d3ea2 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedByJoiningStrategy.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedByJoiningStrategy.java
@@ -1,13 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.core.context;
import java.util.Iterator;
@@ -34,8 +33,7 @@ public interface MappedByJoiningStrategy
/**
* String associated with changes to the attribute property of this object
*/
- String MAPPED_BY_ATTRIBUTE_PROPERTY =
- "mappedByAttributeProperty"; //$NON-NLS-1$
+ String MAPPED_BY_ATTRIBUTE_PROPERTY = "mappedByAttribute"; //$NON-NLS-1$
/**
* Return the attribute of this object. A null indicates that the resource
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitMetadata.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitMetadata.java
index e168a538cf..8d187e24a8 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitMetadata.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitMetadata.java
@@ -25,7 +25,7 @@ public interface PersistenceUnitMetadata extends XmlContextNode
{
boolean isXmlMappingMetadataComplete();
void setXmlMappingMetadataComplete(boolean value);
- String XML_MAPPING_METADATA_COMPLETE_PROPERTY = "xmlMappingMetadataCompleteProperty"; //$NON-NLS-1$
+ String XML_MAPPING_METADATA_COMPLETE_PROPERTY = "xmlMappingMetadataComplete"; //$NON-NLS-1$
OrmPersistenceUnitDefaults getPersistenceUnitDefaults();
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitTransactionType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitTransactionType.java
index 46e1a84673..27906884c2 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitTransactionType.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitTransactionType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -22,10 +22,10 @@ import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionTy
*/
public enum PersistenceUnitTransactionType
{
- /** Corresponds to JTA transaction type **/
+ /** Corresponds to JTA transaction type */
JTA,
- /** Corresponds to RESOURCE_LOCAL transaction type **/
+ /** Corresponds to RESOURCE_LOCAL transaction type */
RESOURCE_LOCAL;
public static PersistenceUnitTransactionType fromXmlResourceModel(XmlPersistenceUnitTransactionType transactionType) {
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.java
index 7e115e6bac..ff1779a29c 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -12,7 +12,7 @@ package org.eclipse.jpt.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
/**
- *
+ * Common Java resource annotation behavior
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -20,24 +20,33 @@ import org.eclipse.jdt.core.dom.CompilationUnit;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*/
-public interface Annotation extends JavaResourceNode
-{
+public interface Annotation
+ extends JavaResourceNode
+{
/**
- * Return the fully qualified annotation name.
+ * Return the annotation's fully qualified name, as opposed to the value of
+ * the annotation's 'name' element. For example:
+ * @com.foo.Bar(name="Thomas")
+ * #getAnnotationName() will return "com.foo.Bar".
+ * In typical subclasses, #getName() would return "Thomas".
* @see JPA
*/
String getAnnotationName();
-
- org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot);
-
+
/**
- * Removing the underyling Java annotation
+ * Return the corresponding JDT DOM annotation from the specified
+ * AST compilation unit.
*/
- void removeAnnotation();
+ org.eclipse.jdt.core.dom.Annotation getJdtAnnotation(CompilationUnit astRoot);
/**
- * Create and add Java annotation
+ * Create and add the corresponding Java annotation to the JDT DOM.
*/
void newAnnotation();
-
+
+ /**
+ * Remove the corresponding Java annotation from the JDT DOM.
+ */
+ void removeAnnotation();
+
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java
index 0915eb7c42..71e914f478 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -12,7 +12,8 @@ package org.eclipse.jpt.core.resource.java;
import java.util.ListIterator;
/**
- * Corresponds to the javax.persistence.AssociationOverride annotation
+ * Corresponds to the JPA annotation
+ * javax.persistence.AssociationOverride
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -20,28 +21,47 @@ import java.util.ListIterator;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*/
-public interface AssociationOverrideAnnotation extends OverrideAnnotation
+public interface AssociationOverrideAnnotation
+ extends OverrideAnnotation
{
String ANNOTATION_NAME = JPA.ASSOCIATION_OVERRIDE;
-
+
/**
- * Corresponds to the joinColumns element of the AssociationOverride annotation.
- * Returns an empty iterator if the joinColumns element does not exist in java.
+ * Corresponds to the 'joinColumns' element of the AssociationOverride annotation.
+ * Return an empty iterator if the element does not exist in Java.
*/
ListIterator<JoinColumnAnnotation> joinColumns();
+ String JOIN_COLUMNS_LIST = "joinColumns"; //$NON-NLS-1$
+ /**
+ * Corresponds to the 'joinColumns' element of the AssociationOverride annotation.
+ */
+ int joinColumnsSize();
+
+ /**
+ * Corresponds to the 'joinColumns' element of the AssociationOverride annotation.
+ */
JoinColumnAnnotation joinColumnAt(int index);
+ /**
+ * Corresponds to the 'joinColumns' element of the AssociationOverride annotation.
+ */
int indexOfJoinColumn(JoinColumnAnnotation joinColumn);
- int joinColumnsSize();
-
+ /**
+ * Corresponds to the 'joinColumns' element of the AssociationOverride annotation.
+ */
JoinColumnAnnotation addJoinColumn(int index);
- void removeJoinColumn(int index);
-
+ /**
+ * Corresponds to the 'joinColumns' element of the AssociationOverride annotation.
+ */
void moveJoinColumn(int targetIndex, int sourceIndex);
+
+ /**
+ * Corresponds to the 'joinColumns' element of the AssociationOverride annotation.
+ */
+ void removeJoinColumn(int index);
- String JOIN_COLUMNS_LIST = "joinColumns"; //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java
index 72b4458666..2506242dd4 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -10,7 +10,8 @@
package org.eclipse.jpt.core.resource.java;
/**
- * Corresponds to the javax.persistence.AttributeOverride annotation
+ * Corresponds to the JPA annotation
+ * javax.persistence.AttributeOverride
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -18,28 +19,29 @@ package org.eclipse.jpt.core.resource.java;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*/
-public interface AttributeOverrideAnnotation extends OverrideAnnotation
+public interface AttributeOverrideAnnotation
+ extends OverrideAnnotation
{
String ANNOTATION_NAME = JPA.ATTRIBUTE_OVERRIDE;
-
+
+
/**
- * Corresponds to the column element of the AttributeOverride annotation.
- * Returns null if the column element does not exist in java.
+ * Corresponds to the 'column' element of the AttributeOverride annotation.
+ * Return null if the element does not exist in Java.
*/
ColumnAnnotation getColumn();
-
+ String COLUMN_PROPERTY = "column"; //$NON-NLS-1$
+
+ ColumnAnnotation getNonNullColumn();
+
/**
- * Add the column element to the AttributeOverride annotation.
+ * Add the 'column' element to the AttributeOverride annotation.
*/
ColumnAnnotation addColumn();
-
+
/**
- * Remove the column element from the AttributeOverride annotation.
+ * Remove the 'column' element from the AttributeOverride annotation.
*/
void removeColumn();
-
- ColumnAnnotation getNonNullColumn();
-
- String COLUMN_PROPERTY = "column"; //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseColumnAnnotation.java
index 56ada49098..31b9abead9 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseColumnAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseColumnAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -13,7 +13,9 @@ import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.utility.TextRange;
/**
- *
+ * Common protocol among
+ * javax.persistence.Column
+ * javax.persistence.JoinColumn
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -21,108 +23,111 @@ import org.eclipse.jpt.core.utility.TextRange;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*/
-public interface BaseColumnAnnotation extends NamedColumnAnnotation
+public interface BaseColumnAnnotation
+ extends NamedColumnAnnotation
{
-
/**
- * Corresponds to the unique element of the *Column annotation.
- * Returns null if the unique valuePair does not exist in the annotation
+ * Corresponds to the 'unique' element of the *Column annotation.
+ * Return null if the element does not exist in Java.
*/
Boolean getUnique();
-
+ String UNIQUE_PROPERTY = "unique"; //$NON-NLS-1$
+
/**
- * Corresponds to the unique element of the *Column annotation.
- * Set to null to remove the unique valuePair from the annotation
+ * Corresponds to the 'unique' element of the *Column annotation.
+ * Set to null to remove the element.
*/
- void setUnique(Boolean unique);
- String UNIQUE_PROPERTY = "unique"; //$NON-NLS-1$
-
+ void setUnique(Boolean unique);
+
/**
- * Corresponds to the nullable element of the *Column annotation.
- * Returns null if the nullable valuePair does not exist in the annotation
+ * Return the {@link TextRange} for the 'unique' element. If the element
+ * does not exist return the {@link TextRange} for the *Column annotation.
*/
- Boolean getNullable();
-
+ TextRange getUniqueTextRange(CompilationUnit astRoot);
+
+
/**
- * Corresponds to the nullable element of the *Column annotation.
- * Set to null to remove the nullable valuePair from the annotation
+ * Corresponds to the 'nullable' element of the *Column annotation.
+ * Return null if the element does not exist in Java.
*/
- void setNullable(Boolean nullable);
+ Boolean getNullable();
String NULLABLE_PROPERTY = "nullable"; //$NON-NLS-1$
-
+
/**
- * Corresponds to the insertable element of the *Column annotation.
- * Returns null if the insertable valuePair does not exist in the annotation
+ * Corresponds to the 'nullable' element of the *Column annotation.
+ * Set to null to remove the element.
*/
- Boolean getInsertable();
-
+ void setNullable(Boolean nullable);
+
/**
- * Corresponds to the insertable element of the *Column annotation.
- * Set to null to remove the insertable valuePair from the annotation
+ * Return the {@link TextRange} for the 'nullable' element. If the element
+ * does not exist return the {@link TextRange} for the *Column annotation.
*/
- void setInsertable(Boolean insertable);
- String INSERTABLE_PROPERTY = "insertable"; //$NON-NLS-1$
-
+ TextRange getNullableTextRange(CompilationUnit astRoot);
+
+
/**
- * Corresponds to the updatable element of the *Column annotation.
- * Returns null if the updatable valuePair does not exist in the annotation
+ * Corresponds to the 'insertable' element of the *Column annotation.
+ * Return null if the element does not exist in Java.
*/
- Boolean getUpdatable();
-
+ Boolean getInsertable();
+ String INSERTABLE_PROPERTY = "insertable"; //$NON-NLS-1$
+
/**
- * Corresponds to the updatable element of the *Column annotation.
- * Set to null to remove the updatable valuePair from the annotation
+ * Corresponds to the 'insertable' element of the *Column annotation.
+ * Set to null to remove the element.
*/
- void setUpdatable(Boolean updatable);
- String UPDATABLE_PROPERTY = "updatable"; //$NON-NLS-1$
-
+ void setInsertable(Boolean insertable);
+
/**
- * Corresponds to the table element of the *Column annotation.
- * Returns null if the table valuePair does not exist in the annotation
+ * Return the {@link TextRange} for the 'insertable' element. If the element
+ * does not exist return the {@link TextRange} for the *Column annotation.
*/
- String getTable();
-
+ TextRange getInsertableTextRange(CompilationUnit astRoot);
+
+
/**
- * Corresponds to the table element of the *Column annotation.
- * Set to null to remove the table valuePair from the annotation
+ * Corresponds to the 'updatable' element of the *Column annotation.
+ * Return null if the element does not exist in Java.
*/
- void setTable(String table);
- String TABLE_PROPERTY = "table"; //$NON-NLS-1$
+ Boolean getUpdatable();
+ String UPDATABLE_PROPERTY = "updatable"; //$NON-NLS-1$
-
/**
- * Return the {@link TextRange} for the unique element. If the unique element
- * does not exist return the {@link TextRange} for the *Column annotation.
+ * Corresponds to the 'updatable' element of the *Column annotation.
+ * Set to null to remove the element.
*/
- TextRange getUniqueTextRange(CompilationUnit astRoot);
+ void setUpdatable(Boolean updatable);
/**
- * Return the {@link TextRange} for the nullable element. If the nullable element
+ * Return the {@link TextRange} for the 'updatable' element. If the element
* does not exist return the {@link TextRange} for the *Column annotation.
*/
- TextRange getNullableTextRange(CompilationUnit astRoot);
+ TextRange getUpdatableTextRange(CompilationUnit astRoot);
+
/**
- * Return the {@link TextRange} for the insertable element. If the insertable element
- * does not exist return the {@link TextRange} for the *Column annotation.
+ * Corresponds to the 'table' element of the *Column annotation.
+ * Return null if the element does not exist in Java.
*/
- TextRange getInsertableTextRange(CompilationUnit astRoot);
+ String getTable();
+ String TABLE_PROPERTY = "table"; //$NON-NLS-1$
/**
- * Return the {@link TextRange} for the updatable element. If the updatable element
- * does not exist return the {@link TextRange} for the *Column annotation.
+ * Corresponds to the 'table' element of the *Column annotation.
+ * Set to null to remove the element.
*/
- TextRange getUpdatableTextRange(CompilationUnit astRoot);
+ void setTable(String table);
/**
- * Return the {@link TextRange} for the table element. If the table element
+ * Return the {@link TextRange} for the 'table' element. If the element
* does not exist return the {@link TextRange} for the *Column annotation.
*/
TextRange getTableTextRange(CompilationUnit astRoot);
/**
- * Return whether the specified postition touches the table element.
- * Return false if the table element does not exist.
+ * Return whether the specified position touches the 'table' element.
+ * Return false if the element does not exist.
*/
boolean tableTouches(int pos, CompilationUnit astRoot);
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java
index 4f4b62aacf..9a10cf8947 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -13,7 +13,8 @@ import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.utility.TextRange;
/**
- *
+ * Corresponds to the JPA annotation
+ * javax.persistence.Column
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -21,63 +22,66 @@ import org.eclipse.jpt.core.utility.TextRange;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*/
-public interface ColumnAnnotation extends BaseColumnAnnotation
+public interface ColumnAnnotation
+ extends BaseColumnAnnotation
{
String ANNOTATION_NAME = JPA.COLUMN;
/**
- * Corresponds to the length element of the javax.persistence.Column annotation.
- * Returns null if the length valuePair does not exist in the annotation
+ * Corresponds to the 'length' element of the Column annotation.
+ * Return null if the element does not exist in Java.
*/
Integer getLength();
-
+ String LENGTH_PROPERTY = "length"; //$NON-NLS-1$
+
/**
- * Corresponds to the length element of the javax.persistence.Column annotation.
- * Set to null to remove the length valuePair from the annotation
+ * Corresponds to the 'length' element of the Column annotation.
+ * Set to null to remove the element.
*/
void setLength(Integer length);
- String LENGTH_PROPERTY = "length"; //$NON-NLS-1$
-
+
/**
- * Corresponds to the precision element of the javax.persistence.Column annotation.
- * Returns null if the precision valuePair does not exist in the annotation
+ * Return the {@link TextRange} for the 'length' element. If element
+ * does not exist return the {@link TextRange} for the Column annotation.
*/
- Integer getPrecision();
-
+ TextRange getLengthTextRange(CompilationUnit astRoot);
+
+
/**
- * Corresponds to the precision element of the javax.persistence.Column annotation.
- * Set to null to remove the precision valuePair from the annotation
+ * Corresponds to the 'precision' element of the Column annotation.
+ * Return null if the element does not exist in Java.
*/
- void setPrecision(Integer precision);
+ Integer getPrecision();
String PRECISION_PROPERTY = "precision"; //$NON-NLS-1$
-
+
/**
- * Corresponds to the scale element of the javax.persistence.Column annotation.
- * Returns null if the scale valuePair does not exist in the annotation
+ * Corresponds to the 'precision' element of the Column annotation.
+ * Set to null to remove the element.
*/
- Integer getScale();
-
+ void setPrecision(Integer precision);
+
/**
- * Corresponds to the scale element of the javax.persistence.Column annotation.
- * Set to null to remove the scale valuePair from the annotation
+ * Return the {@link TextRange} for the 'precision' element. If element
+ * does not exist return the {@link TextRange} for the Column annotation.
*/
- void setScale(Integer scale);
- String SCALE_PROPERTY = "scale"; //$NON-NLS-1$
+ TextRange getPrecisionTextRange(CompilationUnit astRoot);
+
/**
- * Return the {@link TextRange} for the length element. If length element
- * does not exist return the {@link TextRange} for the Column annotation.
+ * Corresponds to the 'scale' element of the Column annotation.
+ * Return null if the element does not exist in Java.
*/
- TextRange getLengthTextRange(CompilationUnit astRoot);
+ Integer getScale();
+ String SCALE_PROPERTY = "scale"; //$NON-NLS-1$
/**
- * Return the {@link TextRange} for the precision element. If precision element
- * does not exist return the {@link TextRange} for the Column annotation.
+ * Corresponds to the 'scale' element of the Column annotation.
+ * Set to null to remove the element.
*/
- TextRange getPrecisionTextRange(CompilationUnit astRoot);
-
+ void setScale(Integer scale);
+
/**
- * Return the {@link TextRange} for the scale element. If scale element
+ * Return the {@link TextRange} for the 'scale' element. If element
* does not exist return the {@link TextRange} for the Column annotation.
*/
TextRange getScaleTextRange(CompilationUnit astRoot);
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java
index 526740b51d..87e8b04c7a 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -10,7 +10,8 @@
package org.eclipse.jpt.core.resource.java;
/**
- * Corresponds to the javax.persistence.DiscriminatorColumn annotation
+ * Corresponds to the JPA annotation
+ * javax.persistence.DiscriminatorColumn
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -18,34 +19,36 @@ package org.eclipse.jpt.core.resource.java;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*/
-public interface DiscriminatorColumnAnnotation extends NamedColumnAnnotation
+public interface DiscriminatorColumnAnnotation
+ extends NamedColumnAnnotation
{
String ANNOTATION_NAME = JPA.DISCRIMINATOR_COLUMN;
/**
- * Corresponds to the discriminatorType element of the javax.persistence.DiscriminatorColumn annotation.
- * Returns null if the discriminatorType valuePair does not exist in the annotation
+ * Corresponds to the 'discriminatorType' element of the DiscriminatorColumn annotation.
+ * Return null if the element does not exist in Java.
*/
DiscriminatorType getDiscriminatorType();
-
+ String DISCRIMINATOR_TYPE_PROPERTY = "discriminatorType"; //$NON-NLS-1$
+
/**
- * Corresponds to the discriminatorType element of the javax.persistence.DiscriminatorColumn annotation.
- * Set the discriminatorType to null to remove the discriminatorType valuePair
+ * Corresponds to the 'discriminatorType' element of the DiscriminatorColumn annotation.
+ * Set the to null to remove the element.
*/
void setDiscriminatorType(DiscriminatorType discriminatorType);
- String DISCRIMINATOR_TYPE_PROPERTY = "discriminatorType"; //$NON-NLS-1$
-
+
+
/**
- * Corresponds to the length element of the javax.persistence.DiscriminatorColumn annotation.
- * Returns null if the length valuePair does not exist in the annotation
+ * Corresponds to the 'length' element of the DiscriminatorColumn annotation.
+ * Return null if the element does not exist in Java.
*/
Integer getLength();
-
+ String LENGTH_PROPERTY = "length"; //$NON-NLS-1$
+
/**
- * Corresponds to the length element of the javax.persistence.DiscriminatorColumn annotation.
- * Set the length to null to remove the length valuePair
+ * Corresponds to the 'length' element of the DiscriminatorColumn annotation.
+ * Set the to null to remove the element.
*/
void setLength(Integer length);
- String LENGTH_PROPERTY = "length"; //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java
index 5e45463126..e5c8ea3e00 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java
@@ -221,13 +221,6 @@ public interface JPA {
String ACCESS__VALUE = "value";
// JPA enums
- String GENERATION_TYPE = PACKAGE_ + "GenerationType";
- String GENERATION_TYPE_ = GENERATION_TYPE + '.';
- String GENERATION_TYPE__AUTO = GENERATION_TYPE_ + "AUTO";
- String GENERATION_TYPE__IDENTITY = GENERATION_TYPE_ + "IDENTITY";
- String GENERATION_TYPE__SEQUENCE = GENERATION_TYPE_ + "SEQUENCE";
- String GENERATION_TYPE__TABLE = GENERATION_TYPE_ + "TABLE";
-
String CASCADE_TYPE = PACKAGE_ + "CascadeType";
String CASCADE_TYPE_ = CASCADE_TYPE + '.';
String CASCADE_TYPE__ALL = CASCADE_TYPE_ + "ALL";
@@ -257,6 +250,13 @@ public interface JPA {
String FLUSH_MODE_TYPE__AUTO = FLUSH_MODE_TYPE_ + "AUTO";
String FLUSH_MODE_TYPE__COMMIT = FLUSH_MODE_TYPE_ + "COMMIT";
+ String GENERATION_TYPE = PACKAGE_ + "GenerationType";
+ String GENERATION_TYPE_ = GENERATION_TYPE + '.';
+ String GENERATION_TYPE__AUTO = GENERATION_TYPE_ + "AUTO";
+ String GENERATION_TYPE__IDENTITY = GENERATION_TYPE_ + "IDENTITY";
+ String GENERATION_TYPE__SEQUENCE = GENERATION_TYPE_ + "SEQUENCE";
+ String GENERATION_TYPE__TABLE = GENERATION_TYPE_ + "TABLE";
+
String INHERITANCE_TYPE = PACKAGE_ + "InheritanceType";
String INHERITANCE_TYPE_ = INHERITANCE_TYPE + '.';
String INHERITANCE_TYPE__JOINED = INHERITANCE_TYPE_ + "JOINED";
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java
index f59a031407..08e3824b0d 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java
@@ -43,9 +43,29 @@ public interface JavaResourceNode
*/
Root getRoot();
+ /**
+ * Return the [source] node's root (the compilation unit).
+ */
+ JavaResourceCompilationUnit getJavaResourceCompilationUnit();
+
+ /**
+ * Return the [source] node's text range in the compilation unit's file.
+ */
+ TextRange getTextRange(CompilationUnit astRoot);
+
+ /**
+ * Initialize the [source] with the specified AST.
+ */
+ void initialize(CompilationUnit astRoot);
+
+ /**
+ * Update the [source] with the specified AST.
+ */
+ void update(CompilationUnit astRoot);
+
/**
- * root of containment hierarchy
+ * root of Java resource containment hierarchy
*/
interface Root extends JavaResourceNode, JpaResourceModel {
@@ -69,13 +89,4 @@ public interface JavaResourceNode
}
- // ========= TODO move all these methods to SourceJavaResourceNode... =================
- void initialize(CompilationUnit astRoot);
-
- JavaResourceCompilationUnit getJavaResourceCompilationUnit();
-
- void update(CompilationUnit astRoot);
-
- TextRange getTextRange(CompilationUnit astRoot);
-
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java
index c2c3c84b7a..b7da39d320 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java
@@ -12,7 +12,7 @@ package org.eclipse.jpt.core.resource.java;
import java.util.Iterator;
/**
- * Java source code persistent type
+ * Java source code or binary persistent type.
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -105,6 +105,7 @@ public interface JavaResourcePersistentType
*/
Iterator<JavaResourcePersistentAttribute> persistableFieldsWithSpecifiedFieldAccess();
+
// ********** methods **********
/**
@@ -125,6 +126,7 @@ public interface JavaResourcePersistentType
*/
Iterator<JavaResourcePersistentAttribute> persistablePropertiesWithSpecifiedPropertyAccess();
+
// ********** attributes **********
/**
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.java
index 02546f8887..15105c6794 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -13,7 +13,8 @@ import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.utility.TextRange;
/**
- *
+ * Corresponds to the JPA annotation
+ * javax.persistence.JoinColumn
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -21,33 +22,33 @@ import org.eclipse.jpt.core.utility.TextRange;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*/
-public interface JoinColumnAnnotation extends BaseColumnAnnotation
+public interface JoinColumnAnnotation
+ extends BaseColumnAnnotation
{
String ANNOTATION_NAME = JPA.JOIN_COLUMN;
/**
- * Corresponds to the referencedColumnName element of the javax.persistence.JoinColumn annotation.
- * Returns null if the referencedColumnName valuePair does not exist in the annotation
+ * Corresponds to the 'referencedColumnName' element of the JoinColumn annotation.
+ * Return null if the element does not exist in Java.
*/
String getReferencedColumnName();
-
+ String REFERENCED_COLUMN_NAME_PROPERTY = "referencedColumnName"; //$NON-NLS-1$
+
/**
- * Corresponds to the referencedColumnName element of the javax.persistence.JoinColumn annotation.
- * Set to null to remove the referencedColumnName valuePait from the Annotation
+ * Corresponds to the 'referencedColumnName' element of the JoinColumn annotation.
+ * Set to null to remove the element.
*/
void setReferencedColumnName(String referencedColumnName);
- String REFERENCED_COLUMN_NAME_PROPERTY = "referencedColumnName"; //$NON-NLS-1$
-
+
/**
- * Return the {@link TextRange} for the referencedColumnName element. If the
- * referencedColumnName element does not exist return the {@link TextRange}
- * for the JoinColumn annotation.
+ * Return the {@link TextRange} for the 'referencedColumnName' element. If element
+ * does not exist return the {@link TextRange} for the JoinColumn annotation.
*/
TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot);
/**
- * Return whether the specified postition touches the referencedColumnName element.
- * Return false if the referencedColumnName element does not exist.
+ * Return whether the specified position touches the 'referencedColumnName' element.
+ * Return false if the element does not exist.
*/
boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot);
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToManyAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToManyAnnotation.java
index 0499b911a4..10520d2614 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToManyAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToManyAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -10,7 +10,8 @@
package org.eclipse.jpt.core.resource.java;
/**
- *
+ * Corresponds to the JPA annotation
+ * javax.persistence.ManyToMany
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOneAnnotation.java
index c2590e92e4..0ac09e6d2d 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOneAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOneAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -13,7 +13,8 @@ import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.utility.TextRange;
/**
- *
+ * Corresponds to the JPA annotation
+ * javax.persistence.ManyToOne
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -21,7 +22,8 @@ import org.eclipse.jpt.core.utility.TextRange;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*/
-public interface ManyToOneAnnotation extends RelationshipMappingAnnotation
+public interface ManyToOneAnnotation
+ extends RelationshipMappingAnnotation
{
String ANNOTATION_NAME = JPA.MANY_TO_ONE;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.java
index 49502da0d9..db067b113f 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -10,7 +10,8 @@
package org.eclipse.jpt.core.resource.java;
/**
- *
+ * Interface for dealing with annotations that can be "nested" within other
+ * annotations, typically within arrays.
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -18,16 +19,18 @@ package org.eclipse.jpt.core.resource.java;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*/
-public interface NestableAnnotation extends Annotation
+public interface NestableAnnotation
+ extends Annotation
{
- //currently using this when the NestableAnnotation is moved from
- //standalone to nested or from nested to standalone.
- //not the greatest since you have to make sure to call all setter methods
+ // currently using this when the NestableAnnotation is moved from
+ // stand-alone to nested or from nested to stand-alone;
+ // not the greatest, since you have to make sure to call all setter methods
void initializeFrom(NestableAnnotation oldAnnotation);
-
+
/**
- * Should only be called when the NestableAnnotation is actually nested
- * @param newIndex
+ * Move the annotation to the specified index within its container annotation.
+ * This should only be called when the annotation is actually nested.
*/
- void moveAnnotation(int newIndex);
+ void moveAnnotation(int index);
+
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToManyAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToManyAnnotation.java
index 97ff6d2086..0d6e9dc55a 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToManyAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToManyAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -10,7 +10,8 @@
package org.eclipse.jpt.core.resource.java;
/**
- *
+ * Corresponds to the JPA annotation
+ * javax.persistence.OneToMany
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOneAnnotation.java
index d9c904b9b2..2e2687ba49 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOneAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOneAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -13,7 +13,8 @@ import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.utility.TextRange;
/**
- *
+ * Corresponds to the JPA annotation
+ * javax.persistence.OneToOne
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -25,23 +26,24 @@ public interface OneToOneAnnotation
extends OwnableRelationshipMappingAnnotation
{
String ANNOTATION_NAME = JPA.ONE_TO_ONE;
-
+
/**
- * Corresponds to the optional element of the OneToOne annotation.
- * Returns null if the optional element does not exist in java.
+ * Corresponds to the 'optional' element of the OneToOne annotation.
+ * Return null if the element does not exist in Java.
*/
Boolean getOptional();
-
+ String OPTIONAL_PROPERTY = "optional"; //$NON-NLS-1$
+
/**
- * Corresponds to the optional element of the OneToOne annotation.
- * Set to null to remove the optional element.
+ * Corresponds to the 'optional' element of the OneToOne annotation.
+ * Set to null to remove the element.
*/
void setOptional(Boolean optional);
- String OPTIONAL_PROPERTY = "optional"; //$NON-NLS-1$
-
+
/**
- * Return the {@link TextRange} for the optional element. If the optional element
+ * Return the {@link TextRange} for the 'optional' element. If the element
* does not exist return the {@link TextRange} for the OneToOne annotation.
*/
TextRange getOptionalTextRange(CompilationUnit astRoot);
+
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OwnableRelationshipMappingAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OwnableRelationshipMappingAnnotation.java
index 3c97a5b0ea..0b6c4f0786 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OwnableRelationshipMappingAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OwnableRelationshipMappingAnnotation.java
@@ -1,21 +1,23 @@
/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.utility.TextRange;
/**
- * Represents a relationship mapping annotation that may have the "mappedBy"
- * element.
+ * Represents a relationship mapping annotation that may have the 'mappedBy'
+ * element:
+ * javax.persistence.ManyToMany
+ * javax.persistence.OneToMany
+ * javax.persistence.OneToOne
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -27,27 +29,28 @@ public interface OwnableRelationshipMappingAnnotation
extends RelationshipMappingAnnotation
{
/**
- * Corresponds to the mappedBy element of the annotation.
- * Returns null if the mappedBy element does not exist in java.
+ * Corresponds to the 'mappedBy' element of the annotation.
+ * Return null if the element does not exist in Java.
*/
String getMappedBy();
+ String MAPPED_BY_PROPERTY = "mappedBy"; //$NON-NLS-1$
/**
- * Corresponds to the mappedBy element of the annotation.
- * Set to null to remove the mappedBy element.
+ * Corresponds to the 'mappedBy' element of the annotation.
+ * Set to null to remove the element.
*/
void setMappedBy(String mappedBy);
- String MAPPED_BY_PROPERTY = "mappedBy"; //$NON-NLS-1$
/**
- * Return the {@link TextRange} for the mappedBy element. If the mappedBy element
+ * Return the {@link TextRange} for the 'mappedBy' element. If the element
* does not exist return the {@link TextRange} for the annotation.
*/
TextRange getMappedByTextRange(CompilationUnit astRoot);
/**
- * Return whether the specified postition touches the mappedBy element.
- * Return false if the mappedBy element does not exist.
+ * Return whether the specified position touches the 'mappedBy' element.
+ * Return false if the element does not exist.
*/
boolean mappedByTouches(int pos, CompilationUnit astRoot);
+
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java
index e3dcd146f5..2787f1fcd3 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -13,7 +13,8 @@ import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.utility.TextRange;
/**
- *
+ * Corresponds to the JPA annotation
+ * javax.persistence.PrimaryKeyJoinColumn
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -21,25 +22,34 @@ import org.eclipse.jpt.core.utility.TextRange;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*/
-public interface PrimaryKeyJoinColumnAnnotation extends NamedColumnAnnotation
+public interface PrimaryKeyJoinColumnAnnotation
+ extends NamedColumnAnnotation
{
String ANNOTATION_NAME = JPA.PRIMARY_KEY_JOIN_COLUMN;
+ /**
+ * Corresponds to the 'referencedColumnName' element of the PrimaryKeyJoinColumn annotation.
+ * Return null if the element does not exist in Java.
+ */
String getReferencedColumnName();
-
- void setReferencedColumnName(String referencedColumnName);
String REFERENCED_COLUMN_NAME_PROPERTY = "referencedColumnName"; //$NON-NLS-1$
/**
- * Return whether the specified postition touches the referencedColumnName element.
- * Return false if the referencedColumnName element does not exist.
+ * Corresponds to the 'referencedColumnName' element of the PrimaryKeyJoinColumn annotation.
+ * Set the to null to remove the element.
*/
- boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot);
+ void setReferencedColumnName(String referencedColumnName);
/**
- * Return the {@link TextRange} for the referencedColumnName element. If the referencedColumnName
- * element does not exist return the {@link TextRange} for the PrimaryKeyJoinColumn annotation.
+ * Return the {@link TextRange} for the 'referencedColumnName' element.
+ * If the element does not exist return the {@link TextRange} for the PrimaryKeyJoinColumn annotation.
*/
TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot);
+ /**
+ * Return whether the specified position touches the 'referencedColumnName' element.
+ * Return false if the element does not exist.
+ */
+ boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot);
+
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.java
index cc7156f515..de99820c8c 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -13,7 +13,8 @@ import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.utility.TextRange;
/**
- * Corresponds to the javax.persistence.SequenceGenerator annotation
+ * Corresponds to the JPA annotation
+ * javax.persistence.SequenceGenerator
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -27,29 +28,28 @@ public interface SequenceGeneratorAnnotation
String ANNOTATION_NAME = JPA.SEQUENCE_GENERATOR;
/**
- * Corresponds to the sequenceName element of the SequenceGenerator annotation.
- * Returns null if the sequenceName element does not exist in java. If no other memberValuePairs exist
- * the SequenceGenerator annotation will be removed as well.
+ * Corresponds to the 'sequenceName' element of the *Generator annotation.
+ * Return null if the element does not exist in Java.
*/
String getSequenceName();
-
+ String SEQUENCE_NAME_PROPERTY = "sequenceName"; //$NON-NLS-1$
+
/**
- * Corresponds to the sequenceName element of the SequenceGenerator annotation.
- * Set to null to remove the sequenceName element. If no other memberValuePairs exist
- * the SequenceGenerator annotation will be removed as well.
+ * Corresponds to the 'sequenceName' element of the *Generator annotation.
+ * Set to null to remove the element. If no other elements exist
+ * the *Generator annotation will be removed as well.
*/
void setSequenceName(String sequenceName);
- String SEQUENCE_NAME_PROPERTY = "sequenceName"; //$NON-NLS-1$
-
+
/**
- * Return the {@link TextRange} for the sequenceName element. If the sequenceName element
+ * Return the {@link TextRange} for the 'sequenceName' element. If the element
* does not exist return the {@link TextRange} for the SequenceGenerator annotation.
*/
TextRange getSequenceNameTextRange(CompilationUnit astRoot);
/**
- * Return whether the specified position touches the sequenceName element.
- * Return false if the sequenceName element does not exist.
+ * Return whether the specified position touches the 'sequenceName' element.
+ * Return false if the element does not exist.
*/
boolean sequenceNameTouches(int pos, CompilationUnit astRoot);
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java
index da69071bca..e8002407aa 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -14,7 +14,8 @@ import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.utility.TextRange;
/**
- * Corresponds to the javax.persistence.TableGenerator annotation
+ * Corresponds to the JPA annotation
+ * javax.persistence.TableGenerator
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -25,184 +26,206 @@ import org.eclipse.jpt.core.utility.TextRange;
public interface TableGeneratorAnnotation
extends GeneratorAnnotation
{
-
String ANNOTATION_NAME = JPA.TABLE_GENERATOR;
/**
- * Corresponds to the table element of the TableGenerator annotation.
- * Returns null if the table element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
+ * Corresponds to the 'table' element of the TableGenerator annotation.
+ * Return null if the element does not exist in Java.
*/
String getTable();
-
+ String TABLE_PROPERTY = "table"; //$NON-NLS-1$
+
/**
- * Corresponds to the table element of the TableGenerator annotation.
- * Set to null to remove the table element. If no other memberValuePairs exist
+ * Corresponds to the 'table' element of the TableGenerator annotation.
+ * Set to null to remove the element. If no other elements exist
* the TableGenerator annotation will be removed as well.
*/
void setTable(String table);
- String TABLE_PROPERTY = "table"; //$NON-NLS-1$
-
+
/**
- * Corresponds to the catalog element of the TableGenerator annotation.
- * Returns null if the catalog element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
+ * Return the {@link TextRange} for the 'table' element. If the element
+ * does not exist return the {@link TextRange} for the TableGenerator annotation.
*/
- String getCatalog();
-
+ TextRange getTableTextRange(CompilationUnit astRoot);
+
/**
- * Corresponds to the catalog element of the TableGenerator annotation.
- * Set to null to remove the catalog element. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
+ * Return whether the specified position touches the 'table' element.
+ * Return false if the element does not exist.
*/
- void setCatalog(String catalog);
- String CATALOG_PROPERTY = "catalog"; //$NON-NLS-1$
-
+ boolean tableTouches(int pos, CompilationUnit astRoot);
+
+
/**
- * Corresponds to the schema element of the TableGenerator annotation.
- * Returns null if the schema element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
+ * Corresponds to the 'schema' element of the TableGenerator annotation.
+ * Return null if the element does not exist in Java.
*/
String getSchema();
-
+ String SCHEMA_PROPERTY = "schema"; //$NON-NLS-1$
+
/**
- * Corresponds to the schema element of the TableGenerator annotation.
- * Set to null to remove the schema element. If no other memberValuePairs exist
+ * Corresponds to the 'schema' element of the TableGenerator annotation.
+ * Set to null to remove the element. If no other elements exist
* the TableGenerator annotation will be removed as well.
*/
void setSchema(String schema);
- String SCHEMA_PROPERTY = "schema"; //$NON-NLS-1$
-
+
/**
- * Corresponds to the pkColumnName element of the TableGenerator annotation.
- * Returns null if the pkColumnName element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
+ * Return the {@link TextRange} for the 'schema' element. If the element
+ * does not exist return the {@link TextRange} for the TableGenerator annotation.
*/
- String getPkColumnName();
-
+ TextRange getSchemaTextRange(CompilationUnit astRoot);
+
/**
- * Corresponds to the pkColumnName element of the TableGenerator annotation.
- * Set to null to remove the pkColumnName element. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
+ * Return whether the specified position touches the 'schema' element.
+ * Return false if the element does not exist.
*/
- void setPkColumnName(String pkColumnName);
- String PK_COLUMN_NAME_PROPERTY = "pkColumnName"; //$NON-NLS-1$
-
+ boolean schemaTouches(int pos, CompilationUnit astRoot);
+
+
/**
- * Corresponds to the valueColumnName element of the TableGenerator annotation.
- * Returns null if the valueColumnName element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
+ * Corresponds to the 'catalog' element of the TableGenerator annotation.
+ * Return null if the element does not exist in Java.
*/
- String getValueColumnName();
-
+ String getCatalog();
+ String CATALOG_PROPERTY = "catalog"; //$NON-NLS-1$
+
/**
- * Corresponds to the valueColumnName element of the TableGenerator annotation.
- * Set to null to remove the valueColumnName element. If no other memberValuePairs exist
+ * Corresponds to the 'catalog' element of the TableGenerator annotation.
+ * Set to null to remove the element. If no other elements exist
* the TableGenerator annotation will be removed as well.
*/
- void setValueColumnName(String valueColumnName);
- String VALUE_COLUMN_NAME_PROPERTY = "valueColumnName"; //$NON-NLS-1$
-
+ void setCatalog(String catalog);
+
/**
- * Corresponds to the pkColumnValue element of the TableGenerator annotation.
- * Returns null if the pkColumnValue element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
+ * Return the {@link TextRange} for the 'catalog' element. If the element
+ * does not exist return the {@link TextRange} for the TableGenerator annotation.
*/
- String getPkColumnValue();
-
+ TextRange getCatalogTextRange(CompilationUnit astRoot);
+
/**
- * Corresponds to the pkColumnValue element of the TableGenerator annotation.
- * Set to null to remove the pkColumnValue element. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
+ * Return whether the specified position touches the 'catalog' element.
+ * Return false if the element does not exist.
*/
- void setPkColumnValue(String pkColumnValue);
- String PK_COLUMN_VALUE_PROPERTY = "pkColumnValue"; //$NON-NLS-1$
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints();
-
- UniqueConstraintAnnotation uniqueConstraintAt(int index);
-
- int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint);
-
- int uniqueConstraintsSize();
+ boolean catalogTouches(int pos, CompilationUnit astRoot);
- UniqueConstraintAnnotation addUniqueConstraint(int index);
-
- void removeUniqueConstraint(int index);
-
- void moveUniqueConstraint(int targetIndex, int sourceIndex);
- String UNIQUE_CONSTRAINTS_LIST = "uniqueConstraints"; //$NON-NLS-1$
/**
- * Return the {@link TextRange} for the table element. If the table element
- * does not exist return the {@link TextRange} for the TableGenerator annotation.
+ * Corresponds to the 'pkColumnName' element of the TableGenerator annotation.
+ * Return null if the element does not exist in Java.
*/
- TextRange getTableTextRange(CompilationUnit astRoot);
+ String getPkColumnName();
+ String PK_COLUMN_NAME_PROPERTY = "pkColumnName"; //$NON-NLS-1$
/**
- * Return whether the specified position touches the table element.
- * Return false if the table element does not exist.
+ * Corresponds to the 'pkColumnName' element of the TableGenerator annotation.
+ * Set to null to remove the element. If no other elements exist
+ * the TableGenerator annotation will be removed as well.
*/
- boolean tableTouches(int pos, CompilationUnit astRoot);
+ void setPkColumnName(String pkColumnName);
/**
- * Return the {@link TextRange} for the catalog element. If the catalog element
+ * Return the {@link TextRange} for the 'pkColumnName' element. If the element
* does not exist return the {@link TextRange} for the TableGenerator annotation.
*/
- TextRange getCatalogTextRange(CompilationUnit astRoot);
+ TextRange getPkColumnNameTextRange(CompilationUnit astRoot);
/**
- * Return whether the specified position touches the catalog element.
- * Return false if the catalog element does not exist.
+ * Return whether the specified position touches the 'pkColumnName' element.
+ * Return false if the element does not exist.
*/
- boolean catalogTouches(int pos, CompilationUnit astRoot);
+ boolean pkColumnNameTouches(int pos, CompilationUnit astRoot);
+
/**
- * Return the {@link TextRange} for the schema element. If the schema element
- * does not exist return the {@link TextRange} for the TableGenerator annotation.
+ * Corresponds to the 'valueColumnName' element of the TableGenerator annotation.
+ * Return null if the element does not exist in Java.
*/
- TextRange getSchemaTextRange(CompilationUnit astRoot);
+ String getValueColumnName();
+ String VALUE_COLUMN_NAME_PROPERTY = "valueColumnName"; //$NON-NLS-1$
/**
- * Return whether the specified position touches the schema element.
- * Return false if the schema element does not exist.
+ * Corresponds to the 'valueColumnName' element of the TableGenerator annotation.
+ * Set to null to remove the element. If no other elements exist
+ * the TableGenerator annotation will be removed as well.
*/
- boolean schemaTouches(int pos, CompilationUnit astRoot);
+ void setValueColumnName(String valueColumnName);
/**
- * Return the {@link TextRange} for the pkColumnName element. If the pkColumnName element
+ * Return the {@link TextRange} for the 'valueColumnName' element. If the element
* does not exist return the {@link TextRange} for the TableGenerator annotation.
*/
- TextRange getPkColumnNameTextRange(CompilationUnit astRoot);
+ TextRange getValueColumnNameTextRange(CompilationUnit astRoot);
/**
- * Return whether the specified position touches the pkColumnName element.
- * Return false if the pkColumnName element does not exist.
+ * Return whether the specified position touches the 'valueColumnName' element.
+ * Return false if the element does not exist.
*/
- boolean pkColumnNameTouches(int pos, CompilationUnit astRoot);
+ boolean valueColumnNameTouches(int pos, CompilationUnit astRoot);
+
/**
- * Return the {@link TextRange} for the valueColumnName element. If the valueColumnName element
- * does not exist return the {@link TextRange} for the TableGenerator annotation.
+ * Corresponds to the 'pkColumnValue' element of the TableGenerator annotation.
+ * Return null if the element does not exist in Java.
*/
- TextRange getValueColumnNameTextRange(CompilationUnit astRoot);
+ String getPkColumnValue();
+ String PK_COLUMN_VALUE_PROPERTY = "pkColumnValue"; //$NON-NLS-1$
/**
- * Return whether the specified position touches the valueColumnName element.
- * Return false if the valueColumnName element does not exist.
+ * Corresponds to the 'pkColumnValue' element of the TableGenerator annotation.
+ * Set to null to remove the element. If no other elements exist
+ * the TableGenerator annotation will be removed as well.
*/
- boolean valueColumnNameTouches(int pos, CompilationUnit astRoot);
+ void setPkColumnValue(String pkColumnValue);
/**
- * Return the {@link TextRange} for the pkColumnValue element. If the pkColumnValue element
+ * Return the {@link TextRange} for the 'pkColumnValue' element. If the element
* does not exist return the {@link TextRange} for the TableGenerator annotation.
*/
TextRange getPkColumnValueTextRange(CompilationUnit astRoot);
/**
- * Return whether the specified position touches the pkColumnValue element.
- * Return false if the pkColumnValue element does not exist.
+ * Return whether the specified position touches the 'pkColumnValue' element.
+ * Return false if the element does not exist.
*/
boolean pkColumnValueTouches(int pos, CompilationUnit astRoot);
+
+ /**
+ * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation.
+ * Return null if the element does not exist in Java.
+ */
+ ListIterator<UniqueConstraintAnnotation> uniqueConstraints();
+ String UNIQUE_CONSTRAINTS_LIST = "uniqueConstraints"; //$NON-NLS-1$
+
+ /**
+ * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation.
+ */
+ int uniqueConstraintsSize();
+
+ /**
+ * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation.
+ */
+ UniqueConstraintAnnotation uniqueConstraintAt(int index);
+
+ /**
+ * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation.
+ */
+ int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint);
+
+ /**
+ * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation.
+ */
+ UniqueConstraintAnnotation addUniqueConstraint(int index);
+
+ /**
+ * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation.
+ */
+ void moveUniqueConstraint(int targetIndex, int sourceIndex);
+
+ /**
+ * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation.
+ * If no other elements exist the TableGenerator annotation will be removed as well.
+ */
+ void removeUniqueConstraint(int index);
+
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Caching.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Caching.java
index 5f9ab68768..e48e49b9b5 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Caching.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Caching.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -34,7 +34,7 @@ public interface Caching extends JpaContextNode
boolean isShared();
boolean isDefaultShared();
- String DEFAULT_SHARED_PROPERTY = "defaultSharedProperty"; //$NON-NLS-1$
+ String DEFAULT_SHARED_PROPERTY = "defaultShared"; //$NON-NLS-1$
boolean DEFAULT_SHARED = true;
Boolean getSpecifiedShared();
@@ -46,7 +46,7 @@ public interface Caching extends JpaContextNode
* @param newSpecifiedShared
*/
void setSpecifiedShared(Boolean newSpecifiedShared);
- String SPECIFIED_SHARED_PROPERTY = "specifiedSharedProperty"; //$NON-NLS-1$
+ String SPECIFIED_SHARED_PROPERTY = "specifiedShared"; //$NON-NLS-1$
//***************** cache type ************************
@@ -58,12 +58,12 @@ public interface Caching extends JpaContextNode
CacheType getType();
CacheType getDefaultType();
- String DEFAULT_TYPE_PROPERTY = "defaultTypeProperty"; //$NON-NLS-1$
+ String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
CacheType DEFAULT_TYPE = CacheType.SOFT_WEAK;
CacheType getSpecifiedType();
void setSpecifiedType(CacheType newSpecifiedType);
- String SPECIFIED_TYPE_PROPERTY = "specifiedTypeProperty"; //$NON-NLS-1$
+ String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
//***************** size ************************
@@ -76,11 +76,11 @@ public interface Caching extends JpaContextNode
int getDefaultSize();
int DEFAULT_SIZE = 100;
- String DEFAULT_SIZE_PROPERTY = "defaultSizeProperty"; //$NON-NLS-1$
+ String DEFAULT_SIZE_PROPERTY = "defaultSize"; //$NON-NLS-1$
Integer getSpecifiedSize();
void setSpecifiedSize(Integer newSpecifiedSize);
- String SPECIFIED_SIZE_PROPERTY = "spcifiedSizeProperty"; //$NON-NLS-1$
+ String SPECIFIED_SIZE_PROPERTY = "specifiedSize"; //$NON-NLS-1$
//***************** always refresh ************************
@@ -91,12 +91,12 @@ public interface Caching extends JpaContextNode
boolean isAlwaysRefresh();
boolean isDefaultAlwaysRefresh();
- String DEFAULT_ALWAYS_REFRESH_PROPERTY = "defaultAlwaysRefreshProperty"; //$NON-NLS-1$
+ String DEFAULT_ALWAYS_REFRESH_PROPERTY = "defaultAlwaysRefresh"; //$NON-NLS-1$
boolean DEFAULT_ALWAYS_REFRESH = false;
Boolean getSpecifiedAlwaysRefresh();
void setSpecifiedAlwaysRefresh(Boolean newSpecifiedAlwaysRefresh);
- String SPECIFIED_ALWAYS_REFRESH_PROPERTY = "specifiedAlwaysRefreshProperty"; //$NON-NLS-1$
+ String SPECIFIED_ALWAYS_REFRESH_PROPERTY = "specifiedAlwaysRefresh"; //$NON-NLS-1$
//***************** refresh only if newer ************************
@@ -108,12 +108,12 @@ public interface Caching extends JpaContextNode
boolean isRefreshOnlyIfNewer();
boolean isDefaultRefreshOnlyIfNewer();
- String DEFAULT_REFRESH_ONLY_IF_NEWER_PROPERTY = "defaultRefreshOnlyIfNewerProperty"; //$NON-NLS-1$
+ String DEFAULT_REFRESH_ONLY_IF_NEWER_PROPERTY = "defaultRefreshOnlyIfNewer"; //$NON-NLS-1$
boolean DEFAULT_REFRESH_ONLY_IF_NEWER = false;
Boolean getSpecifiedRefreshOnlyIfNewer();
void setSpecifiedRefreshOnlyIfNewer(Boolean newSpecifiedRefreshOnlyIfNewer);
- String SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY = "specifiedRefreshOnlyIfNewerProperty"; //$NON-NLS-1$
+ String SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY = "specifiedRefreshOnlyIfNewer"; //$NON-NLS-1$
//***************** disable hits ************************
@@ -125,12 +125,12 @@ public interface Caching extends JpaContextNode
boolean isDisableHits();
boolean isDefaultDisableHits();
- String DEFAULT_DISABLE_HITS_PROPERTY = "defaultDisableHitsProperty"; //$NON-NLS-1$
+ String DEFAULT_DISABLE_HITS_PROPERTY = "defaultDisableHits"; //$NON-NLS-1$
boolean DEFAULT_DISABLE_HITS = false;
Boolean getSpecifiedDisableHits();
void setSpecifiedDisableHits(Boolean newSpecifiedDisableHits);
- String SPECIFIED_DISABLE_HITS_PROPERTY = "specifiedDisableHitsProperty"; //$NON-NLS-1$
+ String SPECIFIED_DISABLE_HITS_PROPERTY = "specifiedDisableHits"; //$NON-NLS-1$
//***************** coordination type ************************
@@ -142,12 +142,12 @@ public interface Caching extends JpaContextNode
CacheCoordinationType getCoordinationType();
CacheCoordinationType getDefaultCoordinationType();
- String DEFAULT_COORDINATION_TYPE_PROPERTY = "defaultCoordinationTypeProperty"; //$NON-NLS-1$
+ String DEFAULT_COORDINATION_TYPE_PROPERTY = "defaultCoordinationType"; //$NON-NLS-1$
CacheCoordinationType DEFAULT_COORDINATION_TYPE = CacheCoordinationType.SEND_OBJECT_CHANGES;
CacheCoordinationType getSpecifiedCoordinationType();
void setSpecifiedCoordinationType(CacheCoordinationType newSpecifiedCoordinationType);
- String SPECIFIED_COORDINATION_TYPE_PROPERTY = "specifiedCoordinationTypeProperty"; //$NON-NLS-1$
+ String SPECIFIED_COORDINATION_TYPE_PROPERTY = "specifiedCoordinationType"; //$NON-NLS-1$
//***************** existence checking ************************
@@ -159,12 +159,12 @@ public interface Caching extends JpaContextNode
ExistenceType getExistenceType();
ExistenceType getDefaultExistenceType();
- String DEFAULT_EXISTENCE_TYPE_PROPERTY = "defaultExistenceTypeProperty"; //$NON-NLS-1$
+ String DEFAULT_EXISTENCE_TYPE_PROPERTY = "defaultExistenceType"; //$NON-NLS-1$
ExistenceType DEFAULT_EXISTENCE_TYPE = ExistenceType.CHECK_DATABASE;
ExistenceType getSpecifiedExistenceType();
void setSpecifiedExistenceType(ExistenceType newSpecifiedExistenceType);
- String SPECIFIED_EXISTENCE_TYPE_PROPERTY = "specifiedExistenceTypeProperty"; //$NON-NLS-1$
+ String SPECIFIED_EXISTENCE_TYPE_PROPERTY = "specifiedExistenceType"; //$NON-NLS-1$
//***************** expiry ************************
@@ -181,7 +181,7 @@ public interface Caching extends JpaContextNode
* @param expiry
*/
void setExpiry(Integer expiry);
- String EXPIRY_PROPERTY = "expiryProperty"; //$NON-NLS-1$
+ String EXPIRY_PROPERTY = "expiry"; //$NON-NLS-1$
/**
@@ -201,5 +201,5 @@ public interface Caching extends JpaContextNode
* Removes the Cache expiryTimeOfDay annotation/xml element
*/
void removeExpiryTimeOfDay();
- String EXPIRY_TIME_OF_DAY_PROPERTY = "expiryTimeOfDayProperty"; //$NON-NLS-1$
+ String EXPIRY_TIME_OF_DAY_PROPERTY = "expiryTimeOfDay"; //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ChangeTracking.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ChangeTracking.java
index 2f64b2d8b6..d4cfa6068b 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ChangeTracking.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ChangeTracking.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -30,10 +30,10 @@ public interface ChangeTracking extends JpaContextNode
ChangeTrackingType getType();
ChangeTrackingType getDefaultType();
- String DEFAULT_TYPE_PROPERTY = "defaultTypeProperty"; //$NON-NLS-1$
+ String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
ChangeTrackingType DEFAULT_TYPE = ChangeTrackingType.AUTO;
ChangeTrackingType getSpecifiedType();
void setSpecifiedType(ChangeTrackingType newSpecifiedType);
- String SPECIFIED_TYPE_PROPERTY = "specifiedTypeProperty"; //$NON-NLS-1$
+ String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ConversionValue.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ConversionValue.java
index 0e36428e39..b3c1b6fe06 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ConversionValue.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ConversionValue.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -27,11 +27,11 @@ public interface ConversionValue extends JpaContextNode
{
String getDataValue();
void setDataValue(String dataValue);
- String DATA_VALUE_PROPERTY = "dataValueProperty"; //$NON-NLS-1$
+ String DATA_VALUE_PROPERTY = "dataValue"; //$NON-NLS-1$
String getObjectValue();
void setObjectValue(String objectValue);
- String OBJECT_VALUE_PROPERTY = "objectValueProperty"; //$NON-NLS-1$
+ String OBJECT_VALUE_PROPERTY = "objectValue"; //$NON-NLS-1$
ObjectTypeConverter getParent();
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Convert.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Convert.java
index 87a9ff9b04..421f5f02a6 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Convert.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Convert.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -32,12 +32,12 @@ public interface Convert extends JpaContextNode, Converter
String getConverterName();
String getDefaultConverterName();
- String DEFAULT_CONVERTER_NAME_PROPERTY = "defaultConverterNameProperty"; //$NON-NLS-1$
+ String DEFAULT_CONVERTER_NAME_PROPERTY = "defaultConverterName"; //$NON-NLS-1$
String getSpecifiedConverterName();
void setSpecifiedConverterName(String converterName);
- String SPECIFIED_CONVERTER_NAME_PROPERTY = "specifiedConverterNameProperty"; //$NON-NLS-1$
+ String SPECIFIED_CONVERTER_NAME_PROPERTY = "specifiedConverterName"; //$NON-NLS-1$
/**
* Reserved name for specifying a serialized object converter. In this
@@ -70,7 +70,7 @@ public interface Convert extends JpaContextNode, Converter
* @return
*/
EclipseLinkConverter getConverter();
- String CONVERTER_PROPERTY = "converterProperty"; //$NON-NLS-1$
+ String CONVERTER_PROPERTY = "converter"; //$NON-NLS-1$
/**
* Possible values for converter type are:
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/CustomConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/CustomConverter.java
index ccf8a356e6..f93fa9d7c0 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/CustomConverter.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/CustomConverter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -26,7 +26,7 @@ public interface CustomConverter extends EclipseLinkConverter
String getConverterClass();
void setConverterClass(String converterClass);
- String CONVERTER_CLASS_PROPERTY = "converterClassProperty"; //$NON-NLS-1$
+ String CONVERTER_CLASS_PROPERTY = "converterClass"; //$NON-NLS-1$
String ECLIPSELINK_CONVERTER_CLASS_NAME = "org.eclipse.persistence.mappings.converters.Converter"; //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Customizer.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Customizer.java
index b0ddf31bfd..fcf6f98004 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Customizer.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/Customizer.java
@@ -29,11 +29,11 @@ public interface Customizer extends JpaContextNode
String getCustomizerClass();
String getDefaultCustomizerClass();
- String DEFAULT_CUSTOMIZER_CLASS_PROPERTY = "defaultCustomizerClassProperty"; //$NON-NLS-1$
+ String DEFAULT_CUSTOMIZER_CLASS_PROPERTY = "defaultCustomizerClass"; //$NON-NLS-1$
String getSpecifiedCustomizerClass();
void setSpecifiedCustomizerClass(String customizerClass);
- String SPECIFIED_CUSTOMIZER_CLASS_PROPERTY = "specifiedCustomizerClassProperty"; //$NON-NLS-1$
+ String SPECIFIED_CUSTOMIZER_CLASS_PROPERTY = "specifiedCustomizerClass"; //$NON-NLS-1$
String ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME = "org.eclipse.persistence.config.DescriptorCustomizer"; //$NON-NLS-1$
/**
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConverter.java
index 9dfb550a3e..ad9b3f91f5 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConverter.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConverter.java
@@ -39,7 +39,7 @@ public interface EclipseLinkConverter extends JpaContextNode
String getName();
void setName(String name);
- String NAME_PROPERTY = "nameProperty"; //$NON-NLS-1$
+ String NAME_PROPERTY = "name"; //$NON-NLS-1$
/**
* Return the char to be used for browsing or creating the converter class IType.
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ExpiryTimeOfDay.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ExpiryTimeOfDay.java
index a5bbdbbfd7..fdc28b2787 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ExpiryTimeOfDay.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ExpiryTimeOfDay.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -28,18 +28,18 @@ public interface ExpiryTimeOfDay extends JpaContextNode
Integer getHour();
void setHour(Integer hour);
- String HOUR_PROPERTY = "hourProperty"; //$NON-NLS-1$
+ String HOUR_PROPERTY = "hour"; //$NON-NLS-1$
Integer getMinute();
void setMinute(Integer minute);
- String MINUTE_PROPERTY = "minuteProperty"; //$NON-NLS-1$
+ String MINUTE_PROPERTY = "minute"; //$NON-NLS-1$
Integer getSecond();
void setSecond(Integer second);
- String SECOND_PROPERTY = "secondProperty"; //$NON-NLS-1$
+ String SECOND_PROPERTY = "second"; //$NON-NLS-1$
Integer getMillisecond();
void setMillisecond(Integer millisecond);
- String MILLISECOND_PROPERTY = "millisecondProperty"; //$NON-NLS-1$
+ String MILLISECOND_PROPERTY = "millisecond"; //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/JoinFetch.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/JoinFetch.java
index da4e7ba413..481c20b36f 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/JoinFetch.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/JoinFetch.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -25,6 +25,6 @@ public interface JoinFetch extends JpaContextNode
{
JoinFetchType getValue();
void setValue(JoinFetchType newJoinFetchValue);
- String VALUE_PROPERTY = "JoinFetch.valueProperty"; //$NON-NLS-1$
+ String VALUE_PROPERTY = "value"; //$NON-NLS-1$
JoinFetchType DEFAULT_VALUE = JoinFetchType.INNER;
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ObjectTypeConverter.java
index e659130306..0c696015de 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ObjectTypeConverter.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/ObjectTypeConverter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -27,11 +27,11 @@ public interface ObjectTypeConverter extends EclipseLinkConverter
{
String getDataType();
void setDataType(String dataType);
- String DATA_TYPE_PROPERTY = "dataTypeProperty"; //$NON-NLS-1$
+ String DATA_TYPE_PROPERTY = "dataType"; //$NON-NLS-1$
String getObjectType();
void setObjectType(String objectType);
- String OBJECT_TYPE_PROPERTY = "objectTypeProperty"; //$NON-NLS-1$
+ String OBJECT_TYPE_PROPERTY = "objectType"; //$NON-NLS-1$
// **************** conversion values **************************************
@@ -73,7 +73,7 @@ public interface ObjectTypeConverter extends EclipseLinkConverter
* Move the conversion values from the source index to the target index.
*/
void moveConversionValue(int targetIndex, int sourceIndex);
- String CONVERSION_VALUES_LIST = "conversionValuesList"; //$NON-NLS-1$
+ String CONVERSION_VALUES_LIST = "conversionValues"; //$NON-NLS-1$
/**
@@ -87,6 +87,6 @@ public interface ObjectTypeConverter extends EclipseLinkConverter
String getDefaultObjectValue();
void setDefaultObjectValue(String defaultObjectValue);
- String DEFAULT_OBJECT_VALUE_PROPERTY = "defaultObjectValueProperty"; //$NON-NLS-1$
+ String DEFAULT_OBJECT_VALUE_PROPERTY = "defaultObjectValue"; //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/PrivateOwned.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/PrivateOwned.java
index edae11e299..82123d38ba 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/PrivateOwned.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/PrivateOwned.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -25,5 +25,5 @@ public interface PrivateOwned extends JpaContextNode
{
boolean isPrivateOwned();
void setPrivateOwned(boolean privateOwned);
- String PRIVATE_OWNED_PROPERTY = "privateOwnedProperty"; //$NON-NLS-1$
+ String PRIVATE_OWNED_PROPERTY = "privateOwned"; //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/StructConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/StructConverter.java
index c351d591c8..323f3ce649 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/StructConverter.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/StructConverter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -25,7 +25,7 @@ public interface StructConverter extends EclipseLinkConverter
{
String getConverterClass();
void setConverterClass(String converterClass);
- String CONVERTER_CLASS_PROPERTY = "converterClassProperty"; //$NON-NLS-1$
+ String CONVERTER_CLASS_PROPERTY = "converterClass"; //$NON-NLS-1$
String ECLIPSELINK_STRUCT_CONVERTER_CLASS_NAME = "org.eclipse.persistence.platform.database.converters.StructConverter"; //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/TypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/TypeConverter.java
index 7297776e04..2398e15012 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/TypeConverter.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/TypeConverter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -25,10 +25,10 @@ public interface TypeConverter extends EclipseLinkConverter
{
String getDataType();
void setDataType(String dataType);
- String DATA_TYPE_PROPERTY = "dataTypeProperty"; //$NON-NLS-1$
+ String DATA_TYPE_PROPERTY = "dataType"; //$NON-NLS-1$
String getObjectType();
void setObjectType(String objectType);
- String OBJECT_TYPE_PROPERTY = "objectTypeProperty"; //$NON-NLS-1$
+ String OBJECT_TYPE_PROPERTY = "objectType"; //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaCaching.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaCaching.java
index efee968cba..dcf170b3a8 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaCaching.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaCaching.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -36,7 +36,7 @@ public interface JavaCaching extends Caching, JavaJpaContextNode
*/
boolean hasExistenceChecking();
void setExistenceChecking(boolean existenceChecking);
- String EXISTENCE_CHECKING_PROPERTY = "existenceCheckingProperty"; //$NON-NLS-1$
+ String EXISTENCE_CHECKING_PROPERTY = "existenceChecking"; //$NON-NLS-1$
/**
* Initialize the EclipseLinkJavaCaching context model object to match the CacheAnnotation
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaConverterHolder.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaConverterHolder.java
index 3feaf70186..0598c77181 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaConverterHolder.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaConverterHolder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -45,21 +45,21 @@ public interface JavaConverterHolder extends JavaJpaContextNode
CustomConverter getCustomConverter();
CustomConverter addCustomConverter();
void removeCustomConverter();
- String CUSTOM_CONVERTER_PROPERTY = "customConverterProperty"; //$NON-NLS-1$
+ String CUSTOM_CONVERTER_PROPERTY = "customConverter"; //$NON-NLS-1$
ObjectTypeConverter getObjectTypeConverter();
ObjectTypeConverter addObjectTypeConverter();
void removeObjectTypeConverter();
- String OBJECT_TYPE_CONVERTER_PROPERTY = "objectTypeConverterProperty"; //$NON-NLS-1$
+ String OBJECT_TYPE_CONVERTER_PROPERTY = "objectTypeConverter"; //$NON-NLS-1$
StructConverter getStructConverter();
StructConverter addStructConverter();
void removeStructConverter();
- String STRUCT_CONVERTER_PROPERTY = "structConverterProperty"; //$NON-NLS-1$
+ String STRUCT_CONVERTER_PROPERTY = "structConverter"; //$NON-NLS-1$
TypeConverter getTypeConverter();
TypeConverter addTypeConverter();
void removeTypeConverter();
- String TYPE_CONVERTER_PROPERTY = "typeCnverterProperty"; //$NON-NLS-1$
+ String TYPE_CONVERTER_PROPERTY = "typeConverter"; //$NON-NLS-1$
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/ConverterHolder.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/ConverterHolder.java
index b814c8e125..df9283d29d 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/ConverterHolder.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/ConverterHolder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -51,7 +51,7 @@ public interface ConverterHolder extends JpaContextNode
*/
void moveCustomConverter(int targetIndex, int sourceIndex);
- String CUSTOM_CONVERTERS_LIST = "customConvertersList"; //$NON-NLS-1$
+ String CUSTOM_CONVERTERS_LIST = "customConverters"; //$NON-NLS-1$
//************ object type converters *********************
@@ -87,7 +87,7 @@ public interface ConverterHolder extends JpaContextNode
*/
void moveObjectTypeConverter(int targetIndex, int sourceIndex);
- String OBJECT_TYPE_CONVERTERS_LIST = "objectTypeConvertersList"; //$NON-NLS-1$
+ String OBJECT_TYPE_CONVERTERS_LIST = "objectTypeConverters"; //$NON-NLS-1$
//************ struct converters *********************
@@ -123,7 +123,7 @@ public interface ConverterHolder extends JpaContextNode
*/
void moveStructConverter(int targetIndex, int sourceIndex);
- String STRUCT_CONVERTERS_LIST = "structConvertersList"; //$NON-NLS-1$
+ String STRUCT_CONVERTERS_LIST = "structConverters"; //$NON-NLS-1$
//************ type converters *********************
@@ -159,6 +159,6 @@ public interface ConverterHolder extends JpaContextNode
*/
void moveTypeConverter(int targetIndex, int sourceIndex);
- String TYPE_CONVERTERS_LIST = "typeConvertersList"; //$NON-NLS-1$
+ String TYPE_CONVERTERS_LIST = "typeConverters"; //$NON-NLS-1$
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/CacheProperties.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/CacheProperties.java
index c06dec92e8..e801f0bad8 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/CacheProperties.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/CacheProperties.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -48,7 +48,7 @@ public class CacheProperties implements Cloneable, Serializable
}
@Override
- public synchronized CacheProperties clone() {
+ public CacheProperties clone() {
try {
return (CacheProperties)super.clone();
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/CustomizerProperties.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/CustomizerProperties.java
index def82d949d..a78c1d6662 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/CustomizerProperties.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/CustomizerProperties.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -42,7 +42,7 @@ public class CustomizerProperties implements Cloneable, Serializable
}
@Override
- public synchronized CustomizerProperties clone() {
+ public CustomizerProperties clone() {
try {
return (CustomizerProperties)super.clone();
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ReadTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ReadTransformerAnnotation.java
index 900198ef6b..0421af56cd 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ReadTransformerAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ReadTransformerAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -10,8 +10,8 @@
package org.eclipse.jpt.eclipselink.core.resource.java;
/**
- * Java resource model interface that corresponds to the Eclipselink
- * annotation org.eclipse.persistence.annotations.ReadTransformer
+ * Corresponds to the EclipseLink annotation
+ * org.eclipse.persistence.annotations.ReadTransformer
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -22,9 +22,8 @@ package org.eclipse.jpt.eclipselink.core.resource.java;
* @version 2.1
* @since 2.1
*/
-public interface ReadTransformerAnnotation extends TransformerAnnotation
+public interface ReadTransformerAnnotation
+ extends TransformerAnnotation
{
-
String ANNOTATION_NAME = EclipseLinkJPA.READ_TRANSFORMER;
-
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/StructConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/StructConverterAnnotation.java
index ff01803fee..ebcd5a2bfb 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/StructConverterAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/StructConverterAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -13,8 +13,8 @@ import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.utility.TextRange;
/**
- * Java resource model interface that corresponds to the Eclipselink
- * annotation org.eclipse.persistence.annotations.StructConverter
+ * Corresponds to the EclipseLink annotation
+ * org.eclipse.persistence.annotations.StructConverter
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -25,25 +25,28 @@ import org.eclipse.jpt.core.utility.TextRange;
* @version 2.1
* @since 2.1
*/
-public interface StructConverterAnnotation extends NamedConverterAnnotation
+public interface StructConverterAnnotation
+ extends NamedConverterAnnotation
{
String ANNOTATION_NAME = EclipseLinkJPA.STRUCT_CONVERTER;
-
+
/**
- * Corresponds to the converter element of the StructConverter annotation.
- * Returns null if the converter element does not exist in java.
+ * Corresponds to the 'converter' element of the StructConverter annotation.
+ * Returns null if the element does not exist in Java.
*/
String getConverter();
-
+ String CONVERTER_PROPERTY = "converter"; //$NON-NLS-1$
+
/**
- * Corresponds to the converter element of the StructConverter annotation.
- * Set to null to remove the converter element.
+ * Corresponds to the 'converter' element of the StructConverter annotation.
+ * Set to null to remove the element.
*/
- void setConverter(String value);
- String CONVERTER_PROPERTY = "converterProperty"; //$NON-NLS-1$
+ void setConverter(String converter);
+
/**
- * Return the {@link TextRange} for the converter element. If the converter element
+ * Return the {@link TextRange} for the 'converter' element. If the element
* does not exist return the {@link TextRange} for the StructConverter annotation.
*/
TextRange getConverterTextRange(CompilationUnit astRoot);
+
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/WriteTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/WriteTransformerAnnotation.java
index 09f2dd96b6..e993c527db 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/WriteTransformerAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/WriteTransformerAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -14,8 +14,8 @@ import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
import org.eclipse.jpt.core.utility.TextRange;
/**
- * Java resource model interface that corresponds to the Eclipselink
- * annotation org.eclipse.persistence.annotations.WriteTransformer
+ * Corresponds to the Eclipselink annotation
+ * org.eclipse.persistence.annotations.WriteTransformer
*
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -26,38 +26,37 @@ import org.eclipse.jpt.core.utility.TextRange;
* @version 2.1
* @since 2.1
*/
-public interface WriteTransformerAnnotation extends TransformerAnnotation
+public interface WriteTransformerAnnotation
+ extends TransformerAnnotation
{
-
String ANNOTATION_NAME = EclipseLinkJPA.WRITE_TRANSFORMER;
-
+
/**
- * Corresponds to the column element of the WriteTransformer annotation.
- * Returns null if the column element does not exist in java.
+ * Corresponds to the 'column' element of the WriteTransformer annotation.
+ * Return null if the element does not exist in Java.
*/
ColumnAnnotation getColumn();
-
+ String COLUMN_PROPERTY = "column"; //$NON-NLS-1$
+
/**
- * Add the column element to the WriteTransformer annotation.
+ * Return a ColumnAnnotation, but do not return null if the 'column'
+ * element does not exist on the WriteTransformer annotation. Instead
+ * return a null object.
*/
- ColumnAnnotation addColumn();
-
+ ColumnAnnotation getNonNullColumn();
+
/**
- * Remove the column element from the WriteTransformer annotation.
+ * Add the 'column' element to the WriteTransformer annotation.
*/
- void removeColumn();
-
+ ColumnAnnotation addColumn();
+
/**
- * Return a ColumnAnnotation, but do not return null if the column
- * element does not exist on the WriteTransformer annotation. Instead
- * return a null object.
+ * Remove the 'column' element from the WriteTransformer annotation.
*/
- ColumnAnnotation getNonNullColumn();
-
- String COLUMN_PROPERTY = "columnProperty"; //$NON-NLS-1$
-
+ void removeColumn();
+
/**
- * Return the {@link TextRange} for the column element. If the column element
+ * Return the {@link TextRange} for the 'column' element. If the element
* does not exist return the {@link TextRange} for the WriteTransformer annotation.
*/
TextRange getColumnTextRange(CompilationUnit astRoot);
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/META-INF/MANIFEST.MF
index 5c83e7af7c..1894d7b43a 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/META-INF/MANIFEST.MF
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/META-INF/MANIFEST.MF
@@ -27,7 +27,7 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
org.eclipse.wst.common.emf;bundle-version="1.1.202",
org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
org.eclipse.wst.common.frameworks.ui;bundle-version="[1.1.200,2.0.0)"
-Export-Package: org.eclipse.jpt.eclipselink.ui;x-internal:=true,
+Export-Package: org.eclipse.jpt.eclipselink.ui,
org.eclipse.jpt.eclipselink.ui.internal;x-internal:=true,
org.eclipse.jpt.eclipselink.ui.internal.ddlgen;x-internal:=true,
org.eclipse.jpt.eclipselink.ui.internal.ddlgen.wizards;x-internal:=true,
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/orm/details/EclipseLinkConverterStateObject.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/orm/details/EclipseLinkConverterStateObject.java
index 472d11d7dd..06a2a5b36b 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/orm/details/EclipseLinkConverterStateObject.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/orm/details/EclipseLinkConverterStateObject.java
@@ -45,12 +45,12 @@ final class EclipseLinkConverterStateObject extends AbstractNode
/**
* Notifies a change in the data value property.
*/
- static final String NAME_PROPERTY = "nameProperty"; //$NON-NLS-1$
+ static final String NAME_PROPERTY = "name"; //$NON-NLS-1$
/**
* Notifies a change in the object value property.
*/
- static final String CONVERTER_TYPE_PROPERTY = "converterTypeProperty"; //$NON-NLS-1$
+ static final String CONVERTER_TYPE_PROPERTY = "converterType"; //$NON-NLS-1$
/**
* Creates a new <code>NewNameStateObject</code>.
diff --git a/jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF
index ee9c80a83e..6f8a263ab3 100644
--- a/jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF
+++ b/jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF
@@ -8,8 +8,8 @@ Bundle-ClassPath: .,
lib/velocity-1.5.jar
Bundle-Localization: plugin
Export-Package: org.eclipse.jpt.gen.internal;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.gen.internal2,
- org.eclipse.jpt.gen.internal2.util
+ org.eclipse.jpt.gen.internal2;x-friends:="org.eclipse.jpt.ui",
+ org.eclipse.jpt.gen.internal2.util;x-friends:="org.eclipse.jpt.ui"
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
org.eclipse.jpt.utility;bundle-version="[1.2.0,2.0.0)",
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal2/ORMGenCustomizer.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal2/ORMGenCustomizer.java
index 7ee0517d63..aecd8da4fb 100644
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal2/ORMGenCustomizer.java
+++ b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal2/ORMGenCustomizer.java
@@ -77,11 +77,11 @@ public abstract class ORMGenCustomizer implements java.io.Serializable
* table name. Includes all association derived from foreign keys
* in user selected tables. Since some of the foreign keys may point to table
* user does not select, this list may be different from mValidAssociations
- **/
+ */
private List<Association> mAssociations;
/*
* List of valid associations within the user selected tables
- * */
+ */
private transient List<Association> mValidAssociations;
private transient boolean mInvalidForeignAssociations;
diff --git a/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF
index 6a53122fe7..f71aece9fc 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF
+++ b/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF
@@ -81,6 +81,7 @@ Export-Package: org.eclipse.jpt.ui,
org.eclipse.jpt.ui.internal.wizards.entity;x-internal:=true,
org.eclipse.jpt.ui.internal.wizards.entity.data.model;x-internal:=true,
org.eclipse.jpt.ui.internal.wizards.entity.data.operation;x-internal:=true,
+ org.eclipse.jpt.ui.internal.wizards.gen;x-internal:=true,
org.eclipse.jpt.ui.internal.wizards.orm;x-internal:=true,
org.eclipse.jpt.ui.jface,
org.eclipse.jpt.ui.navigator,
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/BaseJpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/BaseJpaPlatformUi.java
index 4b024f655c..479ca7c189 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/BaseJpaPlatformUi.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/BaseJpaPlatformUi.java
@@ -80,7 +80,7 @@ public abstract class BaseJpaPlatformUi
// ********** platform ui providers **********
- protected synchronized ListIterator<JpaPlatformUiProvider> platformUiProviders() {
+ protected ListIterator<JpaPlatformUiProvider> platformUiProviders() {
return new ArrayListIterator<JpaPlatformUiProvider>(this.platformUiProviders);
}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManagerFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManagerFactory.java
index 63c0d66869..91283acf55 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManagerFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManagerFactory.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
+ * Copyright (c) 2006, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
*
- * Contributors: Oracle. - initial API and implementation
- *
- *******************************************************************************/
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.ui.internal.selection;
import java.util.HashMap;
@@ -18,7 +18,7 @@ import org.eclipse.ui.PlatformUI;
public class SelectionManagerFactory
{
- private static SelectionManagerFactory INSTANCE;
+ private static volatile SelectionManagerFactory INSTANCE;
private static Object MUTEX = new Object();
@@ -48,7 +48,7 @@ public class SelectionManagerFactory
}
- private Map<IWorkbenchWindow, DefaultJpaSelectionManager> managers;
+ Map<IWorkbenchWindow, DefaultJpaSelectionManager> managers;
private WindowListener windowListener;
@@ -67,9 +67,9 @@ public class SelectionManagerFactory
* Returns the JpaSelectionManager for the IWorkbenchWindow.
* Creates a new one if none exists yet.
*/
- private DefaultJpaSelectionManager internalGetSelectionManager(IWorkbenchWindow window) {
+ DefaultJpaSelectionManager internalGetSelectionManager(IWorkbenchWindow window) {
if (window == null) {
- throw new IllegalArgumentException("The IWorkbenchWindow cannot be null");
+ throw new IllegalArgumentException("The IWorkbenchWindow cannot be null"); //$NON-NLS-1$
}
if (! managers.containsKey(window)) {
@@ -82,9 +82,11 @@ public class SelectionManagerFactory
}
- private class WindowListener implements IWindowListener
+ class WindowListener implements IWindowListener
{
- public void windowOpened(IWorkbenchWindow aWindow) {}
+ public void windowOpened(IWorkbenchWindow aWindow) {
+ // do nothing
+ }
public void windowClosed(IWorkbenchWindow aWindow) {
DefaultJpaSelectionManager manager = internalGetSelectionManager(aWindow);
@@ -92,8 +94,12 @@ public class SelectionManagerFactory
managers.remove(aWindow);
}
- public void windowActivated(IWorkbenchWindow aWindow) {}
+ public void windowActivated(IWorkbenchWindow aWindow) {
+ // do nothing
+ }
- public void windowDeactivated(IWorkbenchWindow aWindow) {}
+ public void windowDeactivated(IWorkbenchWindow aWindow) {
+ // do nothing
+ }
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Counter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Counter.java
index fbe3cde738..b684384bb9 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Counter.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Counter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -79,7 +79,7 @@ public final class Counter
if ( ! (o instanceof Counter)) {
return false;
}
- return this.count == ((Counter) o).count;
+ return this.count == ((Counter) o).count();
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java
index b3c69b1f5a..bbd87c4a8c 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2005, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -2584,7 +2584,7 @@ public final class StringTools {
}
/*
- * The index of the first non-whitespace character is passed in.
+ * The index of the first whitespace character is passed in.
*/
private static void removeAllWhitespaceOn_(char[] string, int first, Writer writer) {
writeStringOn(string, 0, first, writer);
@@ -2613,7 +2613,7 @@ public final class StringTools {
}
/*
- * The index of the first non-whitespace character is passed in.
+ * The index of the first whitespace character is passed in.
*/
private static void removeAllWhitespaceOn_(char[] string, int first, StringBuffer sb) {
sb.append(string, 0, first);
@@ -2642,7 +2642,7 @@ public final class StringTools {
}
/*
- * The index of the first non-whitespace character is passed in.
+ * The index of the first whitespace character is passed in.
*/
private static void removeAllWhitespaceOn_(char[] string, int first, StringBuilder sb) {
sb.append(string, 0, first);
@@ -2654,6 +2654,215 @@ public final class StringTools {
}
}
}
+//===============================
+ /**
+ * Compress the whitespace in the specified string and return the result.
+ * The whitespace is compressed by replacing any occurrence of one or more
+ * whitespace characters with a single space.
+ * String#compressWhitespace()
+ */
+ public static String compressWhitespace(String string) {
+ char[] string2 = string.toCharArray();
+ int first = indexOfWhitespace_(string2);
+ return (first == -1) ? string : new String(compressWhitespace_(string2, first));
+ }
+
+ /**
+ * Compress the whitespace
+ * in the specified string and append the result to the
+ * specified writer.
+ * The whitespace is compressed by replacing any occurrence of one or more
+ * whitespace characters with a single space.
+ * String#compressWhitespaceOn(Writer)
+ */
+ public static void compressWhitespaceOn(String string, Writer writer) {
+ char[] string2 = string.toCharArray();
+ int first = indexOfWhitespace_(string2);
+ if (first == -1) {
+ writeStringOn(string, writer);
+ } else {
+ compressWhitespaceOn_(string2, first, writer);
+ }
+ }
+
+ /**
+ * Compress the whitespace
+ * in the specified string and append the result to the
+ * specified string buffer.
+ * The whitespace is compressed by replacing any occurrence of one or more
+ * whitespace characters with a single space.
+ * String#compressWhitespaceOn(StringBuffer)
+ */
+ public static void compressWhitespaceOn(String string, StringBuffer sb) {
+ char[] string2 = string.toCharArray();
+ int first = indexOfWhitespace_(string2);
+ if (first == -1) {
+ sb.append(string);
+ } else {
+ compressWhitespaceOn_(string2, first, sb);
+ }
+ }
+
+ /**
+ * Compress the whitespace
+ * in the specified string and append the result to the
+ * specified string builder.
+ * The whitespace is compressed by replacing any occurrence of one or more
+ * whitespace characters with a single space.
+ * String#compressWhitespaceOn(StringBuilder)
+ */
+ public static void compressWhitespaceOn(String string, StringBuilder sb) {
+ char[] string2 = string.toCharArray();
+ int first = indexOfWhitespace_(string2);
+ if (first == -1) {
+ sb.append(string);
+ } else {
+ compressWhitespaceOn_(string2, first, sb);
+ }
+ }
+
+ /**
+ * Compress the whitespace in the specified string and return the result.
+ * The whitespace is compressed by replacing any occurrence of one or more
+ * whitespace characters with a single space.
+ * String#compressWhitespace()
+ */
+ public static char[] compressWhitespace(char[] string) {
+ int first = indexOfWhitespace_(string);
+ return (first == -1) ? string : compressWhitespace_(string, first);
+ }
+
+ /*
+ * The index of the first whitespace character is passed in.
+ */
+ private static char[] compressWhitespace_(char[] string, int first) {
+ StringBuilder sb = new StringBuilder(string.length);
+ compressWhitespaceOn_(string, first, sb);
+ return convertToCharArray(sb);
+ }
+
+ /**
+ * Compress the whitespace
+ * in the specified string and append the result to the
+ * specified writer.
+ * The whitespace is compressed by replacing any occurrence of one or more
+ * whitespace characters with a single space.
+ * String#compressWhitespaceOn(Writer)
+ */
+ public static void compressWhitespaceOn(char[] string, Writer writer) {
+ int first = indexOfWhitespace_(string);
+ if (first == -1) {
+ writeStringOn(string, writer);
+ } else {
+ compressWhitespaceOn_(string, first, writer);
+ }
+ }
+
+ /*
+ * The index of the first whitespace character is passed in.
+ */
+ private static void compressWhitespaceOn_(char[] string, int first, Writer writer) {
+ writeStringOn(string, 0, first, writer);
+ boolean spaceWritten = false;
+ int len = string.length;
+ for (int i = first; i < len; i++) {
+ char c = string[i];
+ if (Character.isWhitespace(c)) {
+ if (spaceWritten) {
+ // skip subsequent whitespace characters
+ } else {
+ // replace first whitespace character with a space
+ spaceWritten = true;
+ writeCharOn(' ', writer);
+ }
+ } else {
+ spaceWritten = false;
+ writeCharOn(c, writer);
+ }
+ }
+ }
+
+ /**
+ * Compress the whitespace
+ * in the specified string and append the result to the
+ * specified string buffer.
+ * The whitespace is compressed by replacing any occurrence of one or more
+ * whitespace characters with a single space.
+ * String#compressWhitespaceOn(StringBuffer)
+ */
+ public static void compressWhitespaceOn(char[] string, StringBuffer sb) {
+ int first = indexOfWhitespace_(string);
+ if (first == -1) {
+ sb.append(string);
+ } else {
+ compressWhitespaceOn_(string, first, sb);
+ }
+ }
+
+ /*
+ * The index of the first whitespace character is passed in.
+ */
+ private static void compressWhitespaceOn_(char[] string, int first, StringBuffer sb) {
+ sb.append(string, 0, first);
+ boolean spaceWritten = false;
+ int len = string.length;
+ for (int i = first; i < len; i++) {
+ char c = string[i];
+ if (Character.isWhitespace(c)) {
+ if (spaceWritten) {
+ // skip subsequent whitespace characters
+ } else {
+ // replace first whitespace character with a space
+ spaceWritten = true;
+ sb.append(' ');
+ }
+ } else {
+ spaceWritten = false;
+ sb.append(c);
+ }
+ }
+ }
+
+ /**
+ * Compress the whitespace
+ * in the specified string and append the result to the
+ * specified string builder.
+ * The whitespace is compressed by replacing any occurrence of one or more
+ * whitespace characters with a single space.
+ * String#compressWhitespaceOn(StringBuilder)
+ */
+ public static void compressWhitespaceOn(char[] string, StringBuilder sb) {
+ int first = indexOfWhitespace_(string);
+ if (first == -1) {
+ sb.append(string);
+ } else {
+ compressWhitespaceOn_(string, first, sb);
+ }
+ }
+
+ /*
+ * The index of the first whitespace character is passed in.
+ */
+ private static void compressWhitespaceOn_(char[] string, int first, StringBuilder sb) {
+ sb.append(string, 0, first);
+ boolean spaceWritten = false;
+ int len = string.length;
+ for (int i = first; i < len; i++) {
+ char c = string[i];
+ if (Character.isWhitespace(c)) {
+ if (spaceWritten) {
+ // skip subsequent whitespace characters
+ } else {
+ // replace first whitespace character with a space
+ spaceWritten = true;
+ sb.append(' ');
+ }
+ } else {
+ spaceWritten = false;
+ sb.append(c);
+ }
+ }
+ }
// ********** common prefix **********
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java
index ba538d6329..887b42d0ec 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java
@@ -24,7 +24,7 @@ import org.eclipse.jpt.utility.internal.StringTools;
* <code>nextLink(Object)</code> method.
* The starting link will be the first object returned by the iterator.
* If the starting link is <code>null</code>, the iterator will be empty.
- * Note that the iterator does not support <code>null</code> elements.
+ * Note this iterator does not support <code>null</code> elements.
*/
public class ChainIterator<E>
implements Iterator<E>
@@ -72,7 +72,7 @@ public class ChainIterator<E>
}
/**
- * Return the next link in the chain.
+ * Return the next link in the chain; null if there are no more links.
*/
protected E nextLink(E currentLink) {
return this.linker.nextLink(currentLink);
@@ -93,7 +93,7 @@ public class ChainIterator<E>
public interface Linker<T> {
/**
- * Return the next link in the chain.
+ * Return the next link in the chain; null if there are no more links.
*/
T nextLink(T currentLink);
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java
index 7976439a03..16e7907dc4 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2005, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -18,8 +18,8 @@ import org.eclipse.jpt.utility.internal.StringTools;
* allowing for concurrent access to the original collection.
* <p>
* The original collection passed to the <code>CloneIterator</code>'s
- * constructor should be synchronized; otherwise you run the risk of
- * a corrupted collection.
+ * constructor should be synchronized (e.g. java.util.Vector);
+ * otherwise you run the risk of a corrupted collection.
* <p>
* By default, a <code>CloneIterator</code> does not support the
* <code>#remove()</code> operation; this is because it does not have
@@ -45,8 +45,8 @@ public class CloneIterator<E>
* The <code>#remove()</code> method will not be supported,
* unless a subclass overrides the <code>#remove(Object)</code>.
*/
- public CloneIterator(Collection<? extends E> c) {
- this(c, Mutator.ReadOnly.<E>instance());
+ public CloneIterator(Collection<? extends E> collection) {
+ this(collection, Mutator.ReadOnly.<E>instance());
}
/**
@@ -54,9 +54,16 @@ public class CloneIterator<E>
* Use the specified mutator to remove objects from the
* original collection.
*/
- public CloneIterator(Collection<? extends E> c, Mutator<E> mutator) {
+ public CloneIterator(Collection<? extends E> collection, Mutator<E> mutator) {
+ this(collection.toArray(), mutator);
+ }
+
+ /**
+ * Internal constructor used by subclasses.
+ */
+ protected CloneIterator(Object[] array, Mutator<E> mutator) {
super();
- this.nestedIterator = new ArrayIterator<Object>(c.toArray());
+ this.nestedIterator = new ArrayIterator<Object>(array);
this.current = null;
this.mutator = mutator;
this.removeAllowed = false;
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java
index 083f535b4a..415f2854bd 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
+ * Copyright (c) 2005, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,9 +9,9 @@
******************************************************************************/
package org.eclipse.jpt.utility.internal.iterators;
-import java.util.Collection;
import java.util.Iterator;
import java.util.NoSuchElementException;
+
import org.eclipse.jpt.utility.internal.StringTools;
/**
@@ -32,7 +32,7 @@ public class CompositeIterator<E>
/**
* Construct an iterator with the specified collection of iterators.
*/
- public CompositeIterator(Collection<? extends Iterator<? extends E>> iterators) {
+ public CompositeIterator(Iterable<? extends Iterator<? extends E>> iterators) {
this(iterators.iterator());
}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GenericIteratorWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GenericIteratorWrapper.java
index 01e5e0a93b..e775f93e0a 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GenericIteratorWrapper.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GenericIteratorWrapper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -15,7 +15,7 @@ import org.eclipse.jpt.utility.internal.StringTools;
/**
* Wrap an iterator on elements of any sub-type of E, converting it into an
* iterator on elements of type E. This shouldn't be a problem since there
- * is no way to add elements to the iterator.
+ * is no way to add invalid elements to the iterator's backing collection.
*/
public class GenericIteratorWrapper<E>
implements Iterator<E>
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GenericListIteratorWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GenericListIteratorWrapper.java
new file mode 100644
index 0000000000..dd5b2c9c6e
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GenericListIteratorWrapper.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.utility.internal.iterators;
+
+import java.util.ListIterator;
+
+import org.eclipse.jpt.utility.internal.StringTools;
+
+/**
+ * Wrap a list iterator on elements of any sub-type of E, converting it into a
+ * list iterator on elements of type E. This shouldn't be a problem since the
+ * resulting list iterator disables the methods that would put invalid elements
+ * in the iterator's backing list (i.e. #set(E) and #add(E)).
+ */
+public class GenericListIteratorWrapper<E>
+ implements ListIterator<E>
+{
+ private final ListIterator<? extends E> listIterator;
+
+ public GenericListIteratorWrapper(ListIterator<? extends E> listIterator) {
+ super();
+ this.listIterator = listIterator;
+ }
+
+ public boolean hasNext() {
+ return this.listIterator.hasNext();
+ }
+
+ public E next() {
+ return this.listIterator.next();
+ }
+
+ public int nextIndex() {
+ return this.listIterator.nextIndex();
+ }
+
+ public boolean hasPrevious() {
+ return this.listIterator.hasPrevious();
+ }
+
+ public E previous() {
+ return this.listIterator.previous();
+ }
+
+ public int previousIndex() {
+ return this.listIterator.previousIndex();
+ }
+
+ public void remove() {
+ this.listIterator.remove();
+ }
+
+ public void set(E e) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void add(E e) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String toString() {
+ return StringTools.buildToStringFor(this, this.listIterator);
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java
index df0a51333d..cc119fda84 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
+ * Copyright (c) 2005, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,8 +9,8 @@
******************************************************************************/
package org.eclipse.jpt.utility.internal.iterators;
-import java.util.Collection;
import java.util.Iterator;
+
import org.eclipse.jpt.utility.internal.StringTools;
/**
@@ -26,7 +26,7 @@ public class ReadOnlyIterator<E>
* Construct an iterator on the specified collection that
* disallows removes.
*/
- public ReadOnlyIterator(Collection<? extends E> c) {
+ public ReadOnlyIterator(Iterable<? extends E> c) {
this(c.iterator());
}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/AbstractModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/AbstractModel.java
index 754d9004b6..8e325e0c00 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/AbstractModel.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/AbstractModel.java
@@ -30,10 +30,12 @@ import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
/**
* Convenience implementation of Model protocol.
*/
-public abstract class AbstractModel implements Model, Serializable {
+public abstract class AbstractModel
+ implements Model, Serializable
+{
/**
* Delegate state/property/collection/list/tree change support to this
- * helper object. The change support object is "lazy-initialized".
+ * helper object. The change support object is "lazily-initialized".
*/
private ChangeSupport changeSupport;
@@ -42,7 +44,6 @@ public abstract class AbstractModel implements Model, Serializable {
/**
* Default constructor.
- * This will call #initialize() on the newly-created instance.
*/
protected AbstractModel() {
super();
@@ -50,6 +51,8 @@ public abstract class AbstractModel implements Model, Serializable {
/**
* This accessor will build the change support when required.
+ * This only helps reduce the footprint of a model that neither has any
+ * listeners added to it nor ever changes (fires any events).
*/
protected synchronized ChangeSupport getChangeSupport() {
if (this.changeSupport == null) {
@@ -687,22 +690,9 @@ public abstract class AbstractModel implements Model, Serializable {
@Override
protected AbstractModel clone() throws CloneNotSupportedException {
AbstractModel clone = (AbstractModel) super.clone();
- clone.postClone();
- return clone;
- }
-
- /**
- * Perform any post-clone processing necessary to
- * successfully disconnect the clone from the original.
- * When this method is called on the clone, the clone
- * is a "shallow" copy of the original (i.e. the clone
- * shares all its instance variables with the original).
- */
- protected void postClone() {
// clear out change support - models do not share listeners
- this.changeSupport = null;
- // when you override this method, don't forget to include:
- // super.postClone();
+ clone.changeSupport = null;
+ return clone;
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeAdapter.java
new file mode 100644
index 0000000000..7842ba3ef0
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeAdapter.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.utility.model.listener;
+
+import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
+
+/**
+ * Convenience implementation of PropertyChangeListener.
+ * This is probably of limited use, since there only a single method to implement;
+ * maybe as a null implementation.
+ *
+ * Provisional API: This class is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public class PropertyChangeAdapter implements PropertyChangeListener {
+
+ public void propertyChanged(PropertyChangeEvent event) {
+ // do nothing
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/StateChangeAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/StateChangeAdapter.java
new file mode 100644
index 0000000000..97c20a828e
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/StateChangeAdapter.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.utility.model.listener;
+
+import org.eclipse.jpt.utility.model.event.StateChangeEvent;
+
+/**
+ * Convenience implementation of StateChangeListener.
+ * This is probably of limited use, since there only a single method to implement;
+ * maybe as a null implementation.
+ *
+ * Provisional API: This class is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public class StateChangeAdapter implements StateChangeListener {
+
+ public void stateChanged(StateChangeEvent event) {
+ // do nothing
+ }
+
+}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java
index 35070dc8cf..401db5dda6 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java
@@ -2571,8 +2571,8 @@ public class JavaEntityTests extends ContextModelTestCase
Entity entity = getJavaEntity();
JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- NamedQuery namedQuery = entity.addNamedQuery(0);
- namedQuery.setName("FOO");
+ NamedQuery namedQuery1 = entity.addNamedQuery(0);
+ namedQuery1.setName("FOO");
ListIterator<NestableAnnotation> javaNamedQueries = typeResource.supportingAnnotations(NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
assertEquals("FOO", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
@@ -2595,7 +2595,7 @@ public class JavaEntityTests extends ContextModelTestCase
ListIterator<NamedQuery> namedQueries = entity.namedQueries();
assertEquals(namedQuery2, namedQueries.next());
assertEquals(namedQuery3, namedQueries.next());
- assertEquals(namedQuery, namedQueries.next());
+ assertEquals(namedQuery1, namedQueries.next());
namedQueries = entity.namedQueries();
assertEquals("BAR", namedQueries.next().getName());
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/connection/ConnectionAdapterTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/connection/ConnectionAdapterTests.java
index 975d0ce60a..d09f5b5b1f 100644
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/connection/ConnectionAdapterTests.java
+++ b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/connection/ConnectionAdapterTests.java
@@ -431,7 +431,7 @@ public class ConnectionAdapterTests extends PersistenceUnitTestCase
// ********** get/set property **********
@Override
- protected synchronized void setProperty(String propertyName, Object newValue) throws Exception {
+ protected void setProperty(String propertyName, Object newValue) throws Exception {
if (propertyName.equals(Connection.TRANSACTION_TYPE_PROPERTY))
this.connection.setTransactionType((PersistenceUnitTransactionType) newValue);
else if (propertyName.equals(Connection.JTA_DATA_SOURCE_PROPERTY))
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java
index 0ec1a56956..0078dcc58b 100644
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java
+++ b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2005, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -584,6 +584,67 @@ public class StringToolsTests extends TestCase {
StringTools.removeAllWhitespaceOn(string, sb);
assertEquals(expectedString, sb.toString());
}
+//////////////////////////////
+ public void testCompressWhitespace() {
+ this.verifyCompressWhitespace("Employee Fred\t", "Employee Fred ");
+ this.verifyCompressWhitespace("\tEmployee \n", " Employee ");
+ this.verifyCompressWhitespace("Employee \t Foo", "Employee Foo");
+ this.verifyCompressWhitespace(" Emp\tloyee \n Foo ", " Emp loyee Foo ");
+ }
+
+ private void verifyCompressWhitespace(String string, String expectedString) {
+ assertEquals(expectedString, StringTools.compressWhitespace(string));
+ }
+
+ public void testCompressWhitespaceCharArray() {
+ this.verifyCompressWhitespaceCharArray("Employee Fred\t", "Employee Fred ");
+ this.verifyCompressWhitespaceCharArray("\tEmployee \n", " Employee ");
+ this.verifyCompressWhitespaceCharArray("Employee \t Foo", "Employee Foo");
+ this.verifyCompressWhitespaceCharArray(" Emp\tloyee \n Foo ", " Emp loyee Foo ");
+ }
+
+ private void verifyCompressWhitespaceCharArray(String string, String expectedString) {
+ assertEquals(expectedString, StringTools.compressWhitespace(string.toCharArray()));
+ }
+
+ public void testCompressWhitespaceOnWriter() {
+ this.verifyCompressWhitespaceOnWriter("Employee Fred\t", "Employee Fred ");
+ this.verifyCompressWhitespaceOnWriter("\tEmployee \n", " Employee ");
+ this.verifyCompressWhitespaceOnWriter("Employee \t Foo", "Employee Foo");
+ this.verifyCompressWhitespaceOnWriter(" Emp\tloyee \n Foo ", " Emp loyee Foo ");
+ }
+
+ private void verifyCompressWhitespaceOnWriter(String string, String expectedString) {
+ Writer writer = new StringWriter();
+ StringTools.compressWhitespaceOn(string, writer);
+ assertEquals(expectedString, writer.toString());
+ }
+
+ public void testCompressWhitespaceOnStringBuffer() {
+ this.verifyCompressWhitespaceOnStringBuffer("Employee Fred\t", "Employee Fred ");
+ this.verifyCompressWhitespaceOnStringBuffer("\tEmployee \n", " Employee ");
+ this.verifyCompressWhitespaceOnStringBuffer("Employee \t Foo", "Employee Foo");
+ this.verifyCompressWhitespaceOnStringBuffer(" Emp\tloyee \n Foo ", " Emp loyee Foo ");
+ }
+
+ private void verifyCompressWhitespaceOnStringBuffer(String string, String expectedString) {
+ StringBuffer sb = new StringBuffer();
+ StringTools.compressWhitespaceOn(string, sb);
+ assertEquals(expectedString, sb.toString());
+ }
+
+ public void testCompressWhitespaceOnStringBuilder() {
+ this.verifyCompressWhitespaceOnStringBuilder("Employee Fred\t", "Employee Fred ");
+ this.verifyCompressWhitespaceOnStringBuilder("\tEmployee \n", " Employee ");
+ this.verifyCompressWhitespaceOnStringBuilder("Employee \t Foo", "Employee Foo");
+ this.verifyCompressWhitespaceOnStringBuilder(" Emp\tloyee \n Foo ", " Emp loyee Foo ");
+ }
+
+ private void verifyCompressWhitespaceOnStringBuilder(String string, String expectedString) {
+ StringBuilder sb = new StringBuilder();
+ StringTools.compressWhitespaceOn(string, sb);
+ assertEquals(expectedString, sb.toString());
+ }
// ********** common prefix **********
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java
index 57fe19877c..c7a4d1c052 100644
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java
+++ b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
+ * Copyright (c) 2005, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -70,7 +70,7 @@ public final class TestTools {
}
/**
- * execute the specified test and dump the results to the console
+ * execute the specified test and return a text output of its results
*/
public static String execute(TestCase testCase) {
long start = System.currentTimeMillis();
@@ -80,9 +80,9 @@ public final class TestTools {
StringWriter stringWriter = new StringWriter();
PrintWriter writer = new PrintWriter(stringWriter);
writer.print(testCase.getName());
- writer.print(": ");
+ writer.print(": "); //$NON-NLS-1$
if (result.wasSuccessful()) {
- writer.println("OK");
+ writer.println("OK"); //$NON-NLS-1$
} else {
TestFailure failure = null;
if (result.failures().hasMoreElements()) {
@@ -92,25 +92,21 @@ public final class TestTools {
}
failure.thrownException().printStackTrace(writer);
}
- writer.print("elapsed time: ");
+ writer.print("elapsed time: "); //$NON-NLS-1$
long elapsed = end - start;
writer.print(elapsed / 1000L);
- writer.println(" sec.");
+ writer.println(" sec."); //$NON-NLS-1$
return stringWriter.toString();
}
- private static final Class<TestCase> TestCase_class = TestCase.class;
-
/**
* Clear out all the instance variable of the specified test case, allowing
* the various test fixtures to be garbage-collected. Typically this is
* called in the #tearDown() method.
*/
public static void clear(TestCase testCase) throws IllegalAccessException {
- for (Class<?> tempClass = testCase.getClass(); tempClass != TestCase_class; tempClass = tempClass.getSuperclass()) {
- Field[] fields = tempClass.getDeclaredFields();
- for (int i = fields.length; i-- > 0;) {
- Field field = fields[i];
+ for (Class<?> clazz = testCase.getClass(); clazz != TestCase_class; clazz = clazz.getSuperclass()) {
+ for (Field field : clazz.getDeclaredFields()) {
// leave primitives alone - they don't get garbage-collected, and we can't set them to null...
if (field.getType().isPrimitive()) {
continue;
@@ -125,6 +121,8 @@ public final class TestTools {
}
}
+ private static final Class<TestCase> TestCase_class = TestCase.class;
+
/**
* Workaround for a JUnit bug: JUnit does not configure the testing Thread
* with a context class loader. This should probably happen in
@@ -134,6 +132,9 @@ public final class TestTools {
Thread.currentThread().setContextClassLoader(TestTools.class.getClassLoader());
}
+ /**
+ * suppressed constructor
+ */
private TestTools() {
super();
throw new UnsupportedOperationException();
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java
index c6045a9f12..0d43074560 100644
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java
+++ b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
+ * Copyright (c) 2005, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -18,6 +18,7 @@ import junit.framework.TestCase;
import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
import org.eclipse.jpt.utility.tests.internal.TestTools;
+@SuppressWarnings("nls")
public class CloneListIteratorTests extends TestCase {
List<String> originalList;
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java
index f198721ef4..61b8c33051 100644
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java
+++ b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -205,10 +205,10 @@ public class CachingTransformationWritablePropertyValueModelTests extends TestCa
private class Person extends AbstractModel {
private String name;
- public static final String NAME_PROPERTY = "nameProperty";
+ public static final String NAME_PROPERTY = "name";
private String parentName;
- public static final String PARENT_NAME_PROPERTY = "parentNameProperty";
+ public static final String PARENT_NAME_PROPERTY = "parentName";
private Person child;

Back to the top