Java Code Examples for com.sun.tools.internal.xjc.model.CAdapter#getAdapterIfKnown()
The following examples show how to use
com.sun.tools.internal.xjc.model.CAdapter#getAdapterIfKnown() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TypeAndAnnotationImpl.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public void annotate(JAnnotatable programElement) { if(typeUse.getAdapterUse()==null && !typeUse.isCollection()) return; // nothing CAdapter adapterUse = typeUse.getAdapterUse(); if(adapterUse!=null) { // ugly, ugly hack if(adapterUse.getAdapterIfKnown() == SwaRefAdapterMarker.class) { programElement.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) programElement.annotate2(XmlJavaTypeAdapterWriter.class).value( adapterUse.adapterType.toType(outline,EXPOSED)); } } if(typeUse.isCollection()) programElement.annotate(XmlList.class); }
Example 2
Source File: TypeAndAnnotationImpl.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public void annotate(JAnnotatable programElement) { if(typeUse.getAdapterUse()==null && !typeUse.isCollection()) return; // nothing CAdapter adapterUse = typeUse.getAdapterUse(); if(adapterUse!=null) { // ugly, ugly hack if(adapterUse.getAdapterIfKnown() == SwaRefAdapterMarker.class) { programElement.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) programElement.annotate2(XmlJavaTypeAdapterWriter.class).value( adapterUse.adapterType.toType(outline,EXPOSED)); } } if(typeUse.isCollection()) programElement.annotate(XmlList.class); }
Example 3
Source File: TypeAndAnnotationImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public void annotate(JAnnotatable programElement) { if(typeUse.getAdapterUse()==null && !typeUse.isCollection()) return; // nothing CAdapter adapterUse = typeUse.getAdapterUse(); if(adapterUse!=null) { // ugly, ugly hack if(adapterUse.getAdapterIfKnown() == SwaRefAdapterMarker.class) { programElement.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) programElement.annotate2(XmlJavaTypeAdapterWriter.class).value( adapterUse.adapterType.toType(outline,EXPOSED)); } } if(typeUse.isCollection()) programElement.annotate(XmlList.class); }
Example 4
Source File: TypeAndAnnotationImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public void annotate(JAnnotatable programElement) { if(typeUse.getAdapterUse()==null && !typeUse.isCollection()) return; // nothing CAdapter adapterUse = typeUse.getAdapterUse(); if(adapterUse!=null) { // ugly, ugly hack if(adapterUse.getAdapterIfKnown() == SwaRefAdapterMarker.class) { programElement.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) programElement.annotate2(XmlJavaTypeAdapterWriter.class).value( adapterUse.adapterType.toType(outline,EXPOSED)); } } if(typeUse.isCollection()) programElement.annotate(XmlList.class); }
Example 5
Source File: TypeAndAnnotationImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public void annotate(JAnnotatable programElement) { if(typeUse.getAdapterUse()==null && !typeUse.isCollection()) return; // nothing CAdapter adapterUse = typeUse.getAdapterUse(); if(adapterUse!=null) { // ugly, ugly hack if(adapterUse.getAdapterIfKnown() == SwaRefAdapterMarker.class) { programElement.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) programElement.annotate2(XmlJavaTypeAdapterWriter.class).value( adapterUse.adapterType.toType(outline,EXPOSED)); } } if(typeUse.isCollection()) programElement.annotate(XmlList.class); }
Example 6
Source File: TypeAndAnnotationImpl.java From hottub with GNU General Public License v2.0 | 6 votes |
public void annotate(JAnnotatable programElement) { if(typeUse.getAdapterUse()==null && !typeUse.isCollection()) return; // nothing CAdapter adapterUse = typeUse.getAdapterUse(); if(adapterUse!=null) { // ugly, ugly hack if(adapterUse.getAdapterIfKnown() == SwaRefAdapterMarker.class) { programElement.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) programElement.annotate2(XmlJavaTypeAdapterWriter.class).value( adapterUse.adapterType.toType(outline,EXPOSED)); } } if(typeUse.isCollection()) programElement.annotate(XmlList.class); }
Example 7
Source File: TypeAndAnnotationImpl.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public void annotate(JAnnotatable programElement) { if(typeUse.getAdapterUse()==null && !typeUse.isCollection()) return; // nothing CAdapter adapterUse = typeUse.getAdapterUse(); if(adapterUse!=null) { // ugly, ugly hack if(adapterUse.getAdapterIfKnown() == SwaRefAdapterMarker.class) { programElement.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) programElement.annotate2(XmlJavaTypeAdapterWriter.class).value( adapterUse.adapterType.toType(outline,EXPOSED)); } } if(typeUse.isCollection()) programElement.annotate(XmlList.class); }
Example 8
Source File: TypeAndAnnotationImpl.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public void annotate(JAnnotatable programElement) { if(typeUse.getAdapterUse()==null && !typeUse.isCollection()) return; // nothing CAdapter adapterUse = typeUse.getAdapterUse(); if(adapterUse!=null) { // ugly, ugly hack if(adapterUse.getAdapterIfKnown() == SwaRefAdapterMarker.class) { programElement.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) programElement.annotate2(XmlJavaTypeAdapterWriter.class).value( adapterUse.adapterType.toType(outline,EXPOSED)); } } if(typeUse.isCollection()) programElement.annotate(XmlList.class); }
Example 9
Source File: BeanGenerator.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Generates {@link XmlJavaTypeAdapter} from {@link PropertyInfo} if necessary. * Also generates other per-property annotations * (such as {@link XmlID}, {@link XmlIDREF}, and {@link XmlMimeType} if necessary. */ public final void generateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field) { CAdapter adapter = prop.getAdapter(); if (adapter != null) { if (adapter.getAdapterIfKnown() == SwaRefAdapterMarker.class) { field.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) XmlJavaTypeAdapterWriter xjtw = field.annotate2(XmlJavaTypeAdapterWriter.class); xjtw.value(adapter.adapterType.toType(this, EXPOSED)); } } switch (prop.id()) { case ID: field.annotate(XmlID.class); break; case IDREF: field.annotate(XmlIDREF.class); break; } if (prop.getExpectedMimeType() != null) { field.annotate2(XmlMimeTypeWriter.class).value(prop.getExpectedMimeType().toString()); } }
Example 10
Source File: BeanGenerator.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Generates {@link XmlJavaTypeAdapter} from {@link PropertyInfo} if necessary. * Also generates other per-property annotations * (such as {@link XmlID}, {@link XmlIDREF}, and {@link XmlMimeType} if necessary. */ public final void generateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field) { CAdapter adapter = prop.getAdapter(); if (adapter != null) { if (adapter.getAdapterIfKnown() == SwaRefAdapterMarker.class) { field.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) XmlJavaTypeAdapterWriter xjtw = field.annotate2(XmlJavaTypeAdapterWriter.class); xjtw.value(adapter.adapterType.toType(this, EXPOSED)); } } switch (prop.id()) { case ID: field.annotate(XmlID.class); break; case IDREF: field.annotate(XmlIDREF.class); break; } if (prop.getExpectedMimeType() != null) { field.annotate2(XmlMimeTypeWriter.class).value(prop.getExpectedMimeType().toString()); } }
Example 11
Source File: BeanGenerator.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Generates {@link XmlJavaTypeAdapter} from {@link PropertyInfo} if necessary. * Also generates other per-property annotations * (such as {@link XmlID}, {@link XmlIDREF}, and {@link XmlMimeType} if necessary. */ public final void generateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field) { CAdapter adapter = prop.getAdapter(); if (adapter != null) { if (adapter.getAdapterIfKnown() == SwaRefAdapterMarker.class) { field.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) XmlJavaTypeAdapterWriter xjtw = field.annotate2(XmlJavaTypeAdapterWriter.class); xjtw.value(adapter.adapterType.toType(this, EXPOSED)); } } switch (prop.id()) { case ID: field.annotate(XmlID.class); break; case IDREF: field.annotate(XmlIDREF.class); break; } if (prop.getExpectedMimeType() != null) { field.annotate2(XmlMimeTypeWriter.class).value(prop.getExpectedMimeType().toString()); } }
Example 12
Source File: BeanGenerator.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Generates {@link XmlJavaTypeAdapter} from {@link PropertyInfo} if necessary. * Also generates other per-property annotations * (such as {@link XmlID}, {@link XmlIDREF}, and {@link XmlMimeType} if necessary. */ public final void generateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field) { CAdapter adapter = prop.getAdapter(); if (adapter != null) { if (adapter.getAdapterIfKnown() == SwaRefAdapterMarker.class) { field.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) XmlJavaTypeAdapterWriter xjtw = field.annotate2(XmlJavaTypeAdapterWriter.class); xjtw.value(adapter.adapterType.toType(this, EXPOSED)); } } switch (prop.id()) { case ID: field.annotate(XmlID.class); break; case IDREF: field.annotate(XmlIDREF.class); break; } if (prop.getExpectedMimeType() != null) { field.annotate2(XmlMimeTypeWriter.class).value(prop.getExpectedMimeType().toString()); } }
Example 13
Source File: BeanGenerator.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Generates {@link XmlJavaTypeAdapter} from {@link PropertyInfo} if necessary. * Also generates other per-property annotations * (such as {@link XmlID}, {@link XmlIDREF}, and {@link XmlMimeType} if necessary. */ public final void generateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field) { CAdapter adapter = prop.getAdapter(); if (adapter != null) { if (adapter.getAdapterIfKnown() == SwaRefAdapterMarker.class) { field.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) XmlJavaTypeAdapterWriter xjtw = field.annotate2(XmlJavaTypeAdapterWriter.class); xjtw.value(adapter.adapterType.toType(this, EXPOSED)); } } switch (prop.id()) { case ID: field.annotate(XmlID.class); break; case IDREF: field.annotate(XmlIDREF.class); break; } if (prop.getExpectedMimeType() != null) { field.annotate2(XmlMimeTypeWriter.class).value(prop.getExpectedMimeType().toString()); } }
Example 14
Source File: BeanGenerator.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Generates {@link XmlJavaTypeAdapter} from {@link PropertyInfo} if necessary. * Also generates other per-property annotations * (such as {@link XmlID}, {@link XmlIDREF}, and {@link XmlMimeType} if necessary. */ public final void generateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field) { CAdapter adapter = prop.getAdapter(); if (adapter != null) { if (adapter.getAdapterIfKnown() == SwaRefAdapterMarker.class) { field.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) XmlJavaTypeAdapterWriter xjtw = field.annotate2(XmlJavaTypeAdapterWriter.class); xjtw.value(adapter.adapterType.toType(this, EXPOSED)); } } switch (prop.id()) { case ID: field.annotate(XmlID.class); break; case IDREF: field.annotate(XmlIDREF.class); break; } if (prop.getExpectedMimeType() != null) { field.annotate2(XmlMimeTypeWriter.class).value(prop.getExpectedMimeType().toString()); } }
Example 15
Source File: BeanGenerator.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Generates {@link XmlJavaTypeAdapter} from {@link PropertyInfo} if necessary. * Also generates other per-property annotations * (such as {@link XmlID}, {@link XmlIDREF}, and {@link XmlMimeType} if necessary. */ public final void generateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field) { CAdapter adapter = prop.getAdapter(); if (adapter != null) { if (adapter.getAdapterIfKnown() == SwaRefAdapterMarker.class) { field.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) XmlJavaTypeAdapterWriter xjtw = field.annotate2(XmlJavaTypeAdapterWriter.class); xjtw.value(adapter.adapterType.toType(this, EXPOSED)); } } switch (prop.id()) { case ID: field.annotate(XmlID.class); break; case IDREF: field.annotate(XmlIDREF.class); break; } if (prop.getExpectedMimeType() != null) { field.annotate2(XmlMimeTypeWriter.class).value(prop.getExpectedMimeType().toString()); } }
Example 16
Source File: BeanGenerator.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Generates {@link XmlJavaTypeAdapter} from {@link PropertyInfo} if necessary. * Also generates other per-property annotations * (such as {@link XmlID}, {@link XmlIDREF}, and {@link XmlMimeType} if necessary. */ public final void generateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field) { CAdapter adapter = prop.getAdapter(); if (adapter != null) { if (adapter.getAdapterIfKnown() == SwaRefAdapterMarker.class) { field.annotate(XmlAttachmentRef.class); } else { // [RESULT] // @XmlJavaTypeAdapter( Foo.class ) XmlJavaTypeAdapterWriter xjtw = field.annotate2(XmlJavaTypeAdapterWriter.class); xjtw.value(adapter.adapterType.toType(this, EXPOSED)); } } switch (prop.id()) { case ID: field.annotate(XmlID.class); break; case IDREF: field.annotate(XmlIDREF.class); break; } if (prop.getExpectedMimeType() != null) { field.annotate2(XmlMimeTypeWriter.class).value(prop.getExpectedMimeType().toString()); } }