diff options
Diffstat (limited to 'jaxb')
15 files changed, 65 insertions, 65 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/DbwsGeneratorUi.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/DbwsGeneratorUi.java index caac712ad2..a1f3c5b674 100644 --- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/DbwsGeneratorUi.java +++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/DbwsGeneratorUi.java @@ -26,8 +26,8 @@ import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.jpt.common.core.gen.JptGenerator; import org.eclipse.jpt.common.core.internal.utility.ProjectTools; import org.eclipse.jpt.common.ui.gen.AbstractJptGenerateJob; -import org.eclipse.jpt.common.utility.filter.Filter; import org.eclipse.jpt.common.utility.internal.StringTools; +import org.eclipse.jpt.common.utility.predicate.Predicate; import org.eclipse.jpt.dbws.eclipselink.core.internal.gen.DbwsGenerator; import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsEclipseLinkUiMessages; import org.eclipse.jpt.dbws.eclipselink.ui.internal.plugin.JptDbwsEclipseLinkUiPlugin; @@ -53,7 +53,7 @@ public class DbwsGeneratorUi private static final String DRIVER_PROPERTY = "driver"; //$NON-NLS-1$ private static final String DBWS_BUILDER_CLASS_NAME = "org.eclipse.persistence.tools.dbws.DBWSBuilder"; //$NON-NLS-1$ - public static final Filter<IProject> PROJECT_HAS_WEB_FACET = new ProjectTools.HasNature(WEB_FACET_ID); + public static final Predicate<IProject> PROJECT_HAS_WEB_FACET = new ProjectTools.HasNature(WEB_FACET_ID); // ********** static methods ********** diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFile.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFile.java index ca7e20da50..0d402bbaea 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFile.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFile.java @@ -51,7 +51,7 @@ public interface JaxbFile this.contentType = contentType; } @Override - public boolean accept(JaxbFile jaxbFile) { + public boolean evaluate(JaxbFile jaxbFile) { return jaxbFile.getContentType().isKindOf(this.contentType); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNamedNodeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNamedNodeMapping.java index 3660c7f887..8726aa3068 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNamedNodeMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNamedNodeMapping.java @@ -9,8 +9,8 @@ ******************************************************************************/ package org.eclipse.jpt.jaxb.core.context; -import org.eclipse.jpt.common.utility.filter.Filter; import org.eclipse.jpt.common.utility.internal.filter.FilterAdapter; +import org.eclipse.jpt.common.utility.predicate.Predicate; import org.eclipse.jpt.jaxb.core.MappingKeys; import org.eclipse.jpt.jaxb.core.xsd.XsdFeature; @@ -66,12 +66,12 @@ public interface XmlNamedNodeMapping XsdFeature getXsdFeature(); - Filter<JaxbAttributeMapping> MAPPING_IS_NAMED_NODE_MAPPING = new MappingIsNamedNodeMapping(); + Predicate<JaxbAttributeMapping> MAPPING_IS_NAMED_NODE_MAPPING = new MappingIsNamedNodeMapping(); class MappingIsNamedNodeMapping extends FilterAdapter<JaxbAttributeMapping> { @Override - public boolean accept(JaxbAttributeMapping mapping) { + public boolean evaluate(JaxbAttributeMapping mapping) { return (mapping.getKey() == MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY || mapping.getKey() == MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaType.java index e01ee2fab5..17c467907b 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaType.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaType.java @@ -53,7 +53,7 @@ public interface JavaType this.typeKind = typeKind; } @Override - public boolean accept(JavaType type) { + public boolean evaluate(JavaType type) { return type.getKind() == this.typeKind; } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java index 74633e9ef2..754b4b25ce 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java @@ -20,13 +20,13 @@ import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType; import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum; import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage; import org.eclipse.jpt.common.core.resource.java.JavaResourceType; -import org.eclipse.jpt.common.utility.filter.Filter; import org.eclipse.jpt.common.utility.internal.ObjectTools; import org.eclipse.jpt.common.utility.internal.StringTools; import org.eclipse.jpt.common.utility.internal.collection.CollectionTools; import org.eclipse.jpt.common.utility.internal.filter.FilterAdapter; import org.eclipse.jpt.common.utility.internal.iterable.IterableTools; import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter; +import org.eclipse.jpt.common.utility.predicate.Predicate; import org.eclipse.jpt.common.utility.transformer.Transformer; import org.eclipse.jpt.jaxb.core.JaxbProject; import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping; @@ -268,12 +268,12 @@ public abstract class AbstractJaxbContextRoot new JavaResourceTypeTransformer()))); } - public static final Filter<JavaResourceAbstractType> JAVA_RESOURCE_TYPE_IS_ANNOTATED = new JavaResourceTypeIsAnnotated(); + public static final Predicate<JavaResourceAbstractType> JAVA_RESOURCE_TYPE_IS_ANNOTATED = new JavaResourceTypeIsAnnotated(); public static class JavaResourceTypeIsAnnotated extends FilterAdapter<JavaResourceAbstractType> { @Override - public boolean accept(JavaResourceAbstractType type) { + public boolean evaluate(JavaResourceAbstractType type) { if (type.getAstNodeType() == JavaResourceAbstractType.AstNodeType.TYPE) { if (type.getAnnotation(JAXB.XML_REGISTRY) != null) { return true; @@ -458,7 +458,7 @@ public abstract class AbstractJaxbContextRoot this.jaxbPackage = jaxbPackage; } @Override - public boolean accept(JavaType javaType) { + public boolean evaluate(JavaType javaType) { return javaType.getTypeName().getPackageName().equals(this.jaxbPackage.getName()); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java index 41346e0274..a73d63603d 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java @@ -20,10 +20,10 @@ import org.eclipse.jpt.common.core.resource.java.JavaResourceMember; import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod; import org.eclipse.jpt.common.core.resource.java.JavaResourceType; import org.eclipse.jpt.common.core.utility.TextRange; -import org.eclipse.jpt.common.utility.filter.Filter; import org.eclipse.jpt.common.utility.internal.StringTools; import org.eclipse.jpt.common.utility.internal.collection.CollectionTools; import org.eclipse.jpt.common.utility.internal.iterable.IterableTools; +import org.eclipse.jpt.common.utility.predicate.Predicate; import org.eclipse.jpt.jaxb.core.context.JaxbAttributesContainer; import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; @@ -192,7 +192,7 @@ public class GenericJavaAttributesContainer this.initializeAnnotatedPropertyAttributes(); } - private void initializeFieldAttributes(Filter<JavaResourceField> filter) { + private void initializeFieldAttributes(Predicate<JavaResourceField> filter) { for (JavaResourceField resourceField : this.getResourceFields(filter)) { this.attributes.add(this.buildField(resourceField)); } @@ -268,31 +268,31 @@ public class GenericJavaAttributesContainer return this.javaResourceType.getMethods(); } - protected Iterable<JavaResourceField> getResourceFields(Filter<JavaResourceField> filter) { + protected Iterable<JavaResourceField> getResourceFields(Predicate<JavaResourceField> filter) { return IterableTools.filter(getResourceFields(), filter); } - protected Iterable<JavaResourceMethod> getResourceMethods(Filter<JavaResourceMethod> filter) { + protected Iterable<JavaResourceMethod> getResourceMethods(Predicate<JavaResourceMethod> filter) { return IterableTools.filter(getResourceMethods(), filter); } - protected Filter<JavaResourceField> buildNonTransientNonStaticResourceFieldsFilter() { - return new Filter<JavaResourceField>() { - public boolean accept(JavaResourceField resourceField) { + protected Predicate<JavaResourceField> buildNonTransientNonStaticResourceFieldsFilter() { + return new Predicate<JavaResourceField>() { + public boolean evaluate(JavaResourceField resourceField) { return memberIsNonTransientNonStatic(resourceField) || resourceField.isAnnotated(); } }; } - protected static Filter<JavaResourceField> PUBLIC_MEMBER_ACCESS_TYPE_RESOURCE_FIELDS_FILTER = new Filter<JavaResourceField>() { - public boolean accept(JavaResourceField resourceField) { + protected static Predicate<JavaResourceField> PUBLIC_MEMBER_ACCESS_TYPE_RESOURCE_FIELDS_FILTER = new Predicate<JavaResourceField>() { + public boolean evaluate(JavaResourceField resourceField) { return memberIsPublicNonTransientNonStatic(resourceField) || resourceField.isAnnotated(); } }; - protected Filter<JavaResourceMethod> buildPersistablePropertyGetterMethodsFilter() { - return new Filter<JavaResourceMethod>() { - public boolean accept(JavaResourceMethod resourceMethod) { + protected Predicate<JavaResourceMethod> buildPersistablePropertyGetterMethodsFilter() { + return new Predicate<JavaResourceMethod>() { + public boolean evaluate(JavaResourceMethod resourceMethod) { return methodIsPersistablePropertyGetter(resourceMethod, getResourceMethods()); } }; @@ -306,9 +306,9 @@ public class GenericJavaAttributesContainer return !resourceMember.isTransient() && !resourceMember.isStatic(); } - protected static Filter<JavaResourceField> ANNOTATED_RESOURCE_FIELDS_FILTER = - new Filter<JavaResourceField>() { - public boolean accept(JavaResourceField resourceField) { + protected static Predicate<JavaResourceField> ANNOTATED_RESOURCE_FIELDS_FILTER = + new Predicate<JavaResourceField>() { + public boolean evaluate(JavaResourceField resourceField) { return resourceField.isAnnotated(); } }; @@ -462,7 +462,7 @@ public class GenericJavaAttributesContainer this.syncRemainingResourceMethods(contextAttributes, resourceMethods); } - private void syncFieldAttributes(HashSet<JaxbPersistentAttribute> contextAttributes, Filter<JavaResourceField> filter) { + private void syncFieldAttributes(HashSet<JaxbPersistentAttribute> contextAttributes, Predicate<JavaResourceField> filter) { for (JavaResourceField resourceField : this.getResourceFields(filter)) { boolean match = false; for (Iterator<JaxbPersistentAttribute> stream = contextAttributes.iterator(); stream.hasNext(); ) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java index 55297e50e6..8d60152c4f 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java @@ -19,7 +19,6 @@ import org.eclipse.jpt.common.core.internal.utility.JDTTools; import org.eclipse.jpt.common.core.resource.java.JavaResourceType; import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.common.utility.collection.Bag; -import org.eclipse.jpt.common.utility.filter.Filter; import org.eclipse.jpt.common.utility.internal.ObjectTools; import org.eclipse.jpt.common.utility.internal.StringTools; import org.eclipse.jpt.common.utility.internal.collection.CollectionTools; @@ -29,6 +28,7 @@ import org.eclipse.jpt.common.utility.internal.iterable.EmptyListIterable; import org.eclipse.jpt.common.utility.internal.iterable.IterableTools; import org.eclipse.jpt.common.utility.internal.iterable.SingleElementIterable; import org.eclipse.jpt.common.utility.iterable.ListIterable; +import org.eclipse.jpt.common.utility.predicate.Predicate; import org.eclipse.jpt.jaxb.core.MappingKeys; import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; import org.eclipse.jpt.jaxb.core.context.JaxbAttributesContainer; @@ -672,12 +672,12 @@ public class GenericJavaClassMapping return allXmlIdMappings.hasNext() ? allXmlIdMappings.next() : null; } - protected static final Filter<XmlNamedNodeMapping> MAPPING_HAS_XML_ID = new MappingHasXmlID(); + protected static final Predicate<XmlNamedNodeMapping> MAPPING_HAS_XML_ID = new MappingHasXmlID(); public static class MappingHasXmlID extends FilterAdapter<XmlNamedNodeMapping> { @Override - public boolean accept(XmlNamedNodeMapping mapping) { + public boolean evaluate(XmlNamedNodeMapping mapping) { return mapping.getXmlID() != null; } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java index 7b158d855c..63f8e31444 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java @@ -17,13 +17,13 @@ import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod; import org.eclipse.jpt.common.core.resource.java.JavaResourceType; import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.common.utility.collection.Bag; -import org.eclipse.jpt.common.utility.filter.Filter; import org.eclipse.jpt.common.utility.internal.StringTools; import org.eclipse.jpt.common.utility.internal.collection.HashBag; import org.eclipse.jpt.common.utility.internal.filter.FilterAdapter; import org.eclipse.jpt.common.utility.internal.iterable.EmptyIterable; import org.eclipse.jpt.common.utility.internal.iterable.IterableTools; import org.eclipse.jpt.jaxb.core.JptJaxbCoreMessages; +import org.eclipse.jpt.common.utility.predicate.Predicate; import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod; import org.eclipse.jpt.jaxb.core.context.JaxbPackage; import org.eclipse.jpt.jaxb.core.context.XmlRegistry; @@ -113,12 +113,12 @@ public class GenericJavaXmlRegistry return IterableTools.filter(getJavaResourceType().getMethods(), METHOD_IS_ELEMENT_FACTORY_METHOD); } - protected static final Filter<JavaResourceMethod> METHOD_IS_ELEMENT_FACTORY_METHOD = new MethodIsElementFactoryMethod(); + protected static final Predicate<JavaResourceMethod> METHOD_IS_ELEMENT_FACTORY_METHOD = new MethodIsElementFactoryMethod(); public static class MethodIsElementFactoryMethod extends FilterAdapter<JavaResourceMethod> { @Override - public boolean accept(JavaResourceMethod method) { + public boolean evaluate(JavaResourceMethod method) { return methodIsElementFactoryMethod(method); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/InternalJaxbPlatformManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/InternalJaxbPlatformManager.java index 22380e60fc..9aceebefd1 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/InternalJaxbPlatformManager.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/InternalJaxbPlatformManager.java @@ -20,10 +20,10 @@ import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.RegistryFactory;
import org.eclipse.jpt.common.core.JptCommonCoreMessages;
import org.eclipse.jpt.common.core.internal.utility.ConfigurationElementTools;
-import org.eclipse.jpt.common.utility.filter.Filter;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.common.utility.internal.iterable.SuperIterableWrapper;
+import org.eclipse.jpt.common.utility.predicate.Predicate;
import org.eclipse.jpt.jaxb.core.JaxbProject;
import org.eclipse.jpt.jaxb.core.JaxbWorkspace;
import org.eclipse.jpt.jaxb.core.JptJaxbCoreMessages;
@@ -347,12 +347,12 @@ public class InternalJaxbPlatformManager return IterableTools.filter(this.getJaxbPlatformConfigs(), this.buildInternalJaxbPlatformConfigFilter());
}
- private Filter<JaxbPlatformConfig> buildInternalJaxbPlatformConfigFilter() {
+ private Predicate<JaxbPlatformConfig> buildInternalJaxbPlatformConfigFilter() {
return new InternalJaxbPlatformConfigFilter(this.getPluginID());
}
/* CU private */ static class InternalJaxbPlatformConfigFilter
- extends Filter.Adapter<JaxbPlatformConfig>
+ extends Predicate.Adapter<JaxbPlatformConfig>
{
private final String prefix;
InternalJaxbPlatformConfigFilter(String prefix) {
@@ -360,7 +360,7 @@ public class InternalJaxbPlatformManager this.prefix = prefix;
}
@Override
- public boolean accept(JaxbPlatformConfig config) {
+ public boolean evaluate(JaxbPlatformConfig config) {
return config.getFactoryClassName().startsWith(this.prefix);
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformConfig.java index 4bd6cbb88f..a886b32e81 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformConfig.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformConfig.java @@ -9,8 +9,8 @@ ******************************************************************************/ package org.eclipse.jpt.jaxb.core.platform; -import org.eclipse.jpt.common.utility.filter.Filter; import org.eclipse.jpt.common.utility.internal.filter.FilterAdapter; +import org.eclipse.jpt.common.utility.predicate.Predicate; import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; /** @@ -75,7 +75,7 @@ public interface JaxbPlatformConfig { this.jaxbFacetVersion = jaxbFacetVersion; } @Override - public boolean accept(JaxbPlatformConfig config) { + public boolean evaluate(JaxbPlatformConfig config) { return config.supportsJaxbFacetVersion(this.jaxbFacetVersion); } } @@ -87,12 +87,12 @@ public interface JaxbPlatformConfig { */ boolean isDefault(); - Filter<JaxbPlatformConfig> IS_DEFAULT = new IsDefault(); + Predicate<JaxbPlatformConfig> IS_DEFAULT = new IsDefault(); class IsDefault - extends Filter.Adapter<JaxbPlatformConfig> + extends Predicate.Adapter<JaxbPlatformConfig> { @Override - public boolean accept(JaxbPlatformConfig config) { + public boolean evaluate(JaxbPlatformConfig config) { return config.isDefault(); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java index 99769809eb..ad75ca5feb 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java @@ -81,7 +81,7 @@ public class XsdComplexTypeDefinition this.namespace = namespace; } @Override - public boolean accept(XSDAttributeUse attrUse) { + public boolean evaluate(XSDAttributeUse attrUse) { return XsdUtil.namespaceEquals(attrUse.getAttributeDeclaration(), this.namespace); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java index 95a77caad4..856ff2904c 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java @@ -70,7 +70,7 @@ public class XsdUtil { this.namespace = namespace; } @Override - public boolean accept(XSDNamedComponent component) { + public boolean evaluate(XSDNamedComponent component) { return namespaceEquals(component, this.namespace); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaClassMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaClassMapping.java index ed4115346e..cbfb036173 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaClassMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaClassMapping.java @@ -10,10 +10,10 @@ package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java; import java.util.List; -import org.eclipse.jpt.common.utility.filter.Filter; import org.eclipse.jpt.common.utility.internal.filter.FilterAdapter; import org.eclipse.jpt.common.utility.internal.iterable.EmptyIterable; import org.eclipse.jpt.common.utility.internal.iterable.IterableTools; +import org.eclipse.jpt.common.utility.predicate.Predicate; import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.XmlNamedNodeMapping; @@ -212,12 +212,12 @@ public class ELJavaClassMapping MAPPING_HAS_KEY); } - protected static final Filter<ELXmlNamedNodeMapping> MAPPING_HAS_KEY = new MappingHasKey(); + protected static final Predicate<ELXmlNamedNodeMapping> MAPPING_HAS_KEY = new MappingHasKey(); public static class MappingHasKey extends FilterAdapter<ELXmlNamedNodeMapping> { @Override - public boolean accept(ELXmlNamedNodeMapping mapping) { + public boolean evaluate(ELXmlNamedNodeMapping mapping) { return (mapping.getXmlID() != null) || (mapping.getXmlKey() != null); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/ELJaxbPackageContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/ELJaxbPackageContentProvider.java index 74461f0cc4..34bf5123bf 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/ELJaxbPackageContentProvider.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/ELJaxbPackageContentProvider.java @@ -1,16 +1,15 @@ /*******************************************************************************
- * Copyright (c) 2012 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) 20012, 2013 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.jaxb.eclipselink.ui.internal.navigator; import java.util.Iterator;
-import org.eclipse.jpt.common.utility.filter.Filter;
import org.eclipse.jpt.common.utility.internal.filter.NotNullFilter;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.common.utility.internal.iterable.SuperIterableWrapper;
@@ -21,6 +20,7 @@ import org.eclipse.jpt.common.utility.internal.model.value.ListCurator; import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyCollectionValueModelAdapter;
import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
+import org.eclipse.jpt.common.utility.predicate.Predicate;
import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
import org.eclipse.jpt.jaxb.core.context.TypeKind;
import org.eclipse.jpt.jaxb.core.context.java.JavaClass;
@@ -80,7 +80,7 @@ public class ELJaxbPackageContentProvider }
protected class JavaTypeFilter
- implements Filter<JavaType> {
+ implements Predicate<JavaType> {
private final ELJaxbContextRoot contextRoot;
@@ -88,7 +88,7 @@ public class ELJaxbPackageContentProvider this.contextRoot = contextRoot;
}
- public boolean accept(JavaType o) {
+ public boolean evaluate(JavaType o) {
String typeName = o.getTypeName().getFullyQualifiedName();
// TODO xml-registry, xml-java-type-adapter
JavaTypeMapping typeMapping = o.getMapping();
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java index 71d833c934..05f703e72a 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java @@ -26,9 +26,9 @@ import org.eclipse.jface.text.contentassist.CompletionProposal; import org.eclipse.jface.text.contentassist.ICompletionProposal; import org.eclipse.jpt.common.core.internal.utility.PlatformTools; import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit; -import org.eclipse.jpt.common.utility.filter.Filter; import org.eclipse.jpt.common.utility.internal.StringTools; import org.eclipse.jpt.common.utility.internal.iterable.IterableTools; +import org.eclipse.jpt.common.utility.predicate.Predicate; import org.eclipse.jpt.jaxb.core.JaxbProject; import org.eclipse.jpt.jaxb.core.JaxbProjectManager; import org.eclipse.jpt.jaxb.core.JaxbWorkspace; @@ -122,7 +122,7 @@ public class JaxbJavaCompletionProposalComputer // the context's "token" is really a sort of "prefix" - it does NOT // correspond to the "start" and "end" we get below... char[] prefix = cc.getToken(); - Filter<String> filter = this.buildPrefixFilter(prefix); + Predicate<String> filter = this.buildPrefixFilter(prefix); // the token "kind" tells us if we are in a String literal already - CompletionContext.TOKEN_KIND_STRING_LITERAL int tokenKind = cc.getTokenKind(); // the token "start" is the offset of the token's first character @@ -156,7 +156,7 @@ public class JaxbJavaCompletionProposalComputer return proposals; } - private Iterable<String> buildCompletionProposals(JaxbContextNode javaNode, int pos, Filter<String> filter) { + private Iterable<String> buildCompletionProposals(JaxbContextNode javaNode, int pos, Predicate<String> filter) { return IterableTools.filter(javaNode.getCompletionProposals(pos), filter); } @@ -201,21 +201,21 @@ public class JaxbJavaCompletionProposalComputer return PlatformTools.getAdapter(PlatformUI.getWorkbench(), JaxbWorkbench.class); } - private Filter<String> buildPrefixFilter(char[] prefix) { + private Predicate<String> buildPrefixFilter(char[] prefix) { return (prefix == null) ? - Filter.Transparent.<String>instance() : + Predicate.True.<String>instance() : new IgnoreCasePrefixFilter(prefix); } private static class IgnoreCasePrefixFilter - implements Filter<String> + implements Predicate<String> { private final String prefix; IgnoreCasePrefixFilter(char[] prefix) { super(); this.prefix = new String(prefix); } - public boolean accept(String s) { + public boolean evaluate(String s) { return StringTools.startsWithIgnoreCase(s, this.prefix); } } |