| package org.eclipse.jpt.jaxb.core.internal.context.java; |
| |
| import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable; |
| import org.eclipse.jpt.jaxb.core.JaxbFactory; |
| import org.eclipse.jpt.jaxb.core.MappingKeys; |
| import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; |
| import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; |
| import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition; |
| import org.eclipse.jpt.jaxb.core.resource.java.JAXB; |
| |
| |
| public class JavaXmlElementRefMappingDefinition |
| extends AbstractJavaAttributeMappingDefinition { |
| |
| // singleton |
| private static final JavaAttributeMappingDefinition INSTANCE = new JavaXmlElementRefMappingDefinition(); |
| |
| |
| /** |
| * Return the singleton. |
| */ |
| public static JavaAttributeMappingDefinition instance() { |
| return INSTANCE; |
| } |
| |
| |
| /** |
| * Enforce singleton usage |
| */ |
| private JavaXmlElementRefMappingDefinition() { |
| super(); |
| } |
| |
| |
| public String getKey() { |
| return MappingKeys.XML_ELEMENT_REF_ATTRIBUTE_MAPPING_KEY; |
| } |
| |
| public String getAnnotationName() { |
| return JAXB.XML_ELEMENT_REF; |
| } |
| |
| public Iterable<String> getSupportingAnnotationNames() { |
| return new ArrayListIterable<String>( new String[] { |
| JAXB.XML_ELEMENT_WRAPPER, |
| JAXB.XML_JAVA_TYPE_ADAPTER }); |
| } |
| |
| public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) { |
| // TODO: move to factory once API opens up again |
| return new GenericJavaXmlElementRefMapping(parent); |
| } |
| } |