public AccessorFilter(EnunciateJackson1Context context, JsonAutoDetect accessType, JsonIgnoreProperties ignoreProperties, XmlAccessorType jaxbAccessorType) { this.context = context; this.accessType = accessType; this.propertiesToIgnore = new TreeSet<String>(); if (ignoreProperties != null) { Collections.addAll(this.propertiesToIgnore, ignoreProperties.value()); } this.honorJaxb = context.isHonorJaxb(); this.jaxbAccessorType = jaxbAccessorType; this.defaultVisibility = context.getDefaultVisibility(); }
public AccessorFilter(EnunciateJackson1Context context, JsonAutoDetect accessType, JsonIgnoreProperties ignoreProperties, XmlAccessorType jaxbAccessorType) { this.context = context; this.accessType = accessType; this.propertiesToIgnore = new TreeSet<String>(); if (ignoreProperties != null) { Collections.addAll(this.propertiesToIgnore, ignoreProperties.value()); } this.honorJaxb = context.isHonorJaxb(); this.jaxbAccessorType = jaxbAccessorType; this.defaultVisibility = context.getDefaultVisibility(); }
protected List<EnumValue> loadEnumValues() { List<VariableElement> enumConstants = enumValues(); List<EnumValue> enumValueMap = new ArrayList<EnumValue>(); HashSet<String> enumValues = new HashSet<String>(enumConstants.size()); for (VariableElement enumConstant : enumConstants) { String value = enumConstant.getSimpleName().toString(); if (context.isHonorJaxb()) { XmlEnumValue enumValue = enumConstant.getAnnotation(XmlEnumValue.class); if (enumValue != null) { value = enumValue.value(); } } if (!enumValues.add(value)) { throw new EnunciateException(getQualifiedName() + ": duplicate enum value: " + value); } enumValueMap.add(new EnumValue(this, enumConstant, enumConstant.getSimpleName().toString(), value)); } return enumValueMap; }
protected List<EnumValue> loadEnumValues() { List<VariableElement> enumConstants = enumValues(); List<EnumValue> enumValueMap = new ArrayList<EnumValue>(); HashSet<String> enumValues = new HashSet<String>(enumConstants.size()); for (VariableElement enumConstant : enumConstants) { String value = enumConstant.getSimpleName().toString(); if (context.isHonorJaxb()) { XmlEnumValue enumValue = enumConstant.getAnnotation(XmlEnumValue.class); if (enumValue != null) { value = enumValue.value(); } } if (!enumValues.add(value)) { throw new EnunciateException(getQualifiedName() + ": duplicate enum value: " + value); } enumValueMap.add(new EnumValue(this, enumConstant, enumConstant.getSimpleName().toString(), value)); } return enumValueMap; }
private static AdapterType findAdapterType(DecoratedTypeMirror maybeContainedAdaptedType, Element referer, PackageElement pckg, EnunciateJackson1Context context) { if (context.isHonorJaxb()) { DecoratedProcessingEnvironment env = context.getContext().getProcessingEnvironment(); TypeMirror adaptedType = TypeMirrorUtils.getComponentType(maybeContainedAdaptedType, env);
private static AdapterType findAdapterType(DecoratedTypeMirror maybeContainedAdaptedType, Element referer, PackageElement pckg, EnunciateJackson1Context context) { if (context.isHonorJaxb()) { DecoratedProcessingEnvironment env = context.getContext().getProcessingEnvironment(); TypeMirror adaptedType = TypeMirrorUtils.getComponentType(maybeContainedAdaptedType, env);
protected void addPotentialJacksonElement(Element declaration, LinkedList<Element> contextStack) { if (declaration instanceof TypeElement) { if (!this.jacksonContext.isKnownTypeDefinition((TypeElement) declaration) && isExplicitTypeDefinition(declaration, this.jacksonContext.isHonorJaxb())) { OneTimeLogMessage.JACKSON_1_DEPRECATED.log(this.context); this.jacksonContext.add(this.jacksonContext.createTypeDefinition((TypeElement) declaration), contextStack); } } }
protected void addPotentialJacksonElement(Element declaration, LinkedList<Element> contextStack) { if (declaration instanceof TypeElement) { if (!this.jacksonContext.isKnownTypeDefinition((TypeElement) declaration) && isExplicitTypeDefinition(declaration, this.jacksonContext.isHonorJaxb())) { OneTimeLogMessage.JACKSON_1_DEPRECATED.log(this.context); this.jacksonContext.add(this.jacksonContext.createTypeDefinition((TypeElement) declaration), contextStack); } } }
public String getJsonRootName() { String rootName = getSimpleName().toString(); if (getContext().isHonorJaxb()) { XmlType xmlType = getAnnotation(XmlType.class); if (xmlType != null) { rootName = xmlType.name(); } XmlRootElement rootElement = getAnnotation(XmlRootElement.class); if (rootElement != null) { rootName = rootElement.name(); } if ("##default".equals(rootName)) { rootName = getSimpleName().toString(); } } JsonRootName jsonRootName = getAnnotation(JsonRootName.class); if (jsonRootName != null) { rootName = jsonRootName.value(); } return rootName; }
public String getJsonRootName() { String rootName = getSimpleName().toString(); if (getContext().isHonorJaxb()) { XmlType xmlType = getAnnotation(XmlType.class); if (xmlType != null) { rootName = xmlType.name(); } XmlRootElement rootElement = getAnnotation(XmlRootElement.class); if (rootElement != null) { rootName = rootElement.name(); } if ("##default".equals(rootName)) { rootName = getSimpleName().toString(); } } JsonRootName jsonRootName = getAnnotation(JsonRootName.class); if (jsonRootName != null) { rootName = jsonRootName.value(); } return rootName; }
public AdapterType(DeclaredType adapterType, EnunciateJackson1Context context) { super(adapterType, context.getContext().getProcessingEnvironment()); if (context.isHonorJaxb()) { DeclaredType adaptorInterfaceType = findXmlAdapterType(adapterType, new TypeVariableContext(), context.getContext().getProcessingEnvironment()); if (adaptorInterfaceType == null) { throw new EnunciateException(adapterType + " is not an instance of javax.xml.bind.annotation.adapters.XmlAdapter."); } List<? extends TypeMirror> adaptorTypeArgs = adaptorInterfaceType.getTypeArguments(); if ((adaptorTypeArgs == null) || (adaptorTypeArgs.size() != 2)) { throw new EnunciateException(adapterType + " must specify both a value type and a bound type."); } this.adaptingType = adaptorTypeArgs.get(0); this.adaptedType = context.getContext().getProcessingEnvironment().getTypeUtils().erasure(adaptorTypeArgs.get(1)); } else { throw new EnunciateException(adapterType + " is not an instance of javax.xml.bind.annotation.adapters.XmlAdapter."); } }
public AdapterType(DeclaredType adapterType, EnunciateJackson1Context context) { super(adapterType, context.getContext().getProcessingEnvironment()); if (context.isHonorJaxb()) { DeclaredType adaptorInterfaceType = findXmlAdapterType(adapterType, new TypeVariableContext(), context.getContext().getProcessingEnvironment()); if (adaptorInterfaceType == null) { throw new EnunciateException(adapterType + " is not an instance of javax.xml.bind.annotation.adapters.XmlAdapter."); } List<? extends TypeMirror> adaptorTypeArgs = adaptorInterfaceType.getTypeArguments(); if ((adaptorTypeArgs == null) || (adaptorTypeArgs.size() != 2)) { throw new EnunciateException(adapterType + " must specify both a value type and a bound type."); } this.adaptingType = adaptorTypeArgs.get(0); this.adaptedType = context.getContext().getProcessingEnvironment().getTypeUtils().erasure(adaptorTypeArgs.get(1)); } else { throw new EnunciateException(adapterType + " is not an instance of javax.xml.bind.annotation.adapters.XmlAdapter."); } }
else if (context.isHonorJaxb() && (xmlElements != null || xmlElementRefs != null)) { typeIdInclusion = JsonTypeInfo.As.WRAPPER_OBJECT;
else if (context.isHonorJaxb() && (xmlElements != null || xmlElementRefs != null)) { typeIdInclusion = JsonTypeInfo.As.WRAPPER_OBJECT;
if (this.context.isHonorJaxb()) { if (getAnnotation(XmlValue.class) != null) { propertyName = "value";
if (this.context.isHonorJaxb()) { if (getAnnotation(XmlValue.class) != null) { propertyName = "value";
boolean alphabetical = context.isPropertiesAlphabetical(); if (context.isHonorJaxb()) { XmlType typeInfo = getAnnotation(XmlType.class); if (typeInfo != null) {
boolean alphabetical = context.isPropertiesAlphabetical(); if (context.isHonorJaxb()) { XmlType typeInfo = getAnnotation(XmlType.class); if (typeInfo != null) {