/** * Return true if a simple type is a straightforward XML Schema representation of an enumeration. * If we discover schemas that are 'enum-like' with more complex structures, we might * make this deal with them. * @param type Simple type, possible an enumeration. * @return true for an enumeration. */ public static boolean isEumeration(XmlSchemaSimpleType type) { XmlSchemaSimpleTypeContent content = type.getContent(); if (!(content instanceof XmlSchemaSimpleTypeRestriction)) { return false; } XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content; List<XmlSchemaFacet> facets = restriction.getFacets(); for (XmlSchemaFacet facet : facets) { if (!(facet instanceof XmlSchemaEnumerationFacet)) { return false; } } return true; }
/** * Return true if a simple type is a straightforward XML Schema representation of an enumeration. * If we discover schemas that are 'enum-like' with more complex structures, we might * make this deal with them. * @param type Simple type, possible an enumeration. * @return true for an enumeration. */ public static boolean isEumeration(XmlSchemaSimpleType type) { XmlSchemaSimpleTypeContent content = type.getContent(); if (!(content instanceof XmlSchemaSimpleTypeRestriction)) { return false; } XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content; List<XmlSchemaFacet> facets = restriction.getFacets(); for (XmlSchemaFacet facet : facets) { if (!(facet instanceof XmlSchemaEnumerationFacet)) { return false; } } return true; }
/** * Return true if a simple type is a straightforward XML Schema representation of an enumeration. * If we discover schemas that are 'enum-like' with more complex structures, we might * make this deal with them. * @param type Simple type, possible an enumeration. * @return true for an enumeration. */ public static boolean isEumeration(XmlSchemaSimpleType type) { XmlSchemaSimpleTypeContent content = type.getContent(); if (!(content instanceof XmlSchemaSimpleTypeRestriction)) { return false; } XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content; List<XmlSchemaFacet> facets = restriction.getFacets(); for (XmlSchemaFacet facet : facets) { if (!(facet instanceof XmlSchemaEnumerationFacet)) { return false; } } return true; }
/** * Return true if a simple type is a straightforward XML Schema representation of an enumeration. * If we discover schemas that are 'enum-like' with more complex structures, we might * make this deal with them. * @param type Simple type, possible an enumeration. * @return true for an enumeration. */ public static boolean isEumeration(XmlSchemaSimpleType type) { XmlSchemaSimpleTypeContent content = type.getContent(); if (!(content instanceof XmlSchemaSimpleTypeRestriction)) { return false; } XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content; List<XmlSchemaFacet> facets = restriction.getFacets(); for (XmlSchemaFacet facet : facets) { if (!(facet instanceof XmlSchemaEnumerationFacet)) { return false; } } return true; }
/** * Return true if a simple type is a straightforward XML Schema representation of an enumeration. * If we discover schemas that are 'enum-like' with more complex structures, we might * make this deal with them. * @param type Simple type, possible an enumeration. * @return true for an enumeration. */ public static boolean isEumeration(XmlSchemaSimpleType type) { XmlSchemaSimpleTypeContent content = type.getContent(); if (!(content instanceof XmlSchemaSimpleTypeRestriction)) { return false; } XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content; List<XmlSchemaFacet> facets = restriction.getFacets(); for (XmlSchemaFacet facet : facets) { if (!(facet instanceof XmlSchemaEnumerationFacet)) { return false; } } return true; }
/** * Retrieve the string values for an enumeration. * @param type */ public static List<String> enumeratorValues(XmlSchemaSimpleType type) { XmlSchemaSimpleTypeContent content = type.getContent(); XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content; List<XmlSchemaFacet> facets = restriction.getFacets(); List<String> values = new ArrayList<>(); for (XmlSchemaFacet facet : facets) { XmlSchemaEnumerationFacet enumFacet = (XmlSchemaEnumerationFacet) facet; values.add(enumFacet.getValue().toString()); } return values; }
/** * Retrieve the string values for an enumeration. * @param type */ public static List<String> enumeratorValues(XmlSchemaSimpleType type) { XmlSchemaSimpleTypeContent content = type.getContent(); XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content; List<XmlSchemaFacet> facets = restriction.getFacets(); List<String> values = new ArrayList<>(); for (XmlSchemaFacet facet : facets) { XmlSchemaEnumerationFacet enumFacet = (XmlSchemaEnumerationFacet) facet; values.add(enumFacet.getValue().toString()); } return values; }
/** * Retrieve the string values for an enumeration. * @param type */ public static List<String> enumeratorValues(XmlSchemaSimpleType type) { XmlSchemaSimpleTypeContent content = type.getContent(); XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content; List<XmlSchemaFacet> facets = restriction.getFacets(); List<String> values = new ArrayList<String>(); for (XmlSchemaFacet facet : facets) { XmlSchemaEnumerationFacet enumFacet = (XmlSchemaEnumerationFacet) facet; values.add(enumFacet.getValue().toString()); } return values; }
/** * Retrieve the string values for an enumeration. * @param type */ public static List<String> enumeratorValues(XmlSchemaSimpleType type) { XmlSchemaSimpleTypeContent content = type.getContent(); XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content; List<XmlSchemaFacet> facets = restriction.getFacets(); List<String> values = new ArrayList<String>(); for (XmlSchemaFacet facet : facets) { XmlSchemaEnumerationFacet enumFacet = (XmlSchemaEnumerationFacet) facet; values.add(enumFacet.getValue().toString()); } return values; }
/** * Retrieve the string values for an enumeration. * @param type * @return */ public static List<String> enumeratorValues(XmlSchemaSimpleType type) { XmlSchemaSimpleTypeContent content = type.getContent(); XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content; List<XmlSchemaFacet> facets = restriction.getFacets(); List<String> values = new ArrayList<String>(); for (XmlSchemaFacet facet : facets) { XmlSchemaEnumerationFacet enumFacet = (XmlSchemaEnumerationFacet) facet; values.add(enumFacet.getValue().toString()); } return values; }
final XmlSchemaSimpleTypeContent content = simpleType.getContent(); if (content instanceof XmlSchemaSimpleTypeList) { final XmlSchemaSimpleTypeList list = (XmlSchemaSimpleTypeList) content;
&& ((XmlSchemaSimpleType)el.getSchemaType()).getContent() instanceof XmlSchemaSimpleTypeList) {
private XmlSchemaSimpleType duplicateXmlSchemaSimpleType(Scope newScope) { XmlSchemaSimpleType oldSimpleType = (XmlSchemaSimpleType) getSchemaType(); XmlSchemaSimpleType simpleType = new XmlSchemaSimpleType(schema, oldSimpleType.isTopLevel()); simpleType.setContent(oldSimpleType.getContent()); simpleType.setName(newScope.toString()); return simpleType; }
XmlSchemaSimpleTypeContent content = xsdSimpleType.getContent(); if (content == null || !(content instanceof XmlSchemaSimpleTypeRestriction)) {
final CobolAnnotations cobolAnnotations) { XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) xsdSimpleType .getContent(); if (restriction != null && restriction.getBaseTypeName() != null) { QName xsdTypeName = restriction.getBaseTypeName();
private static void processXmlSchemaSimpleType(XmlSchemaSimpleType xmlSchema, JavaMethod jm, JavaParameter parameter, MessagePartInfo part) { if (xmlSchema.getContent() instanceof XmlSchemaSimpleTypeList && (!part.isElement() || !jm.isWrapperStyle())) { parameter.annotate(new XmlListAnotator(jm.getInterface())); } if (Constants.XSD_HEXBIN.equals(xmlSchema.getQName()) && (!part.isElement() || !jm.isWrapperStyle())) { parameter.annotate(new XmlJavaTypeAdapterAnnotator(jm.getInterface(), HexBinaryAdapter.class)); } }
private static void processXmlSchemaSimpleType(XmlSchemaSimpleType xmlSchema, JavaMethod method, MessagePartInfo part) { if (xmlSchema.getContent() instanceof XmlSchemaSimpleTypeList && (!part.isElement() || !method.isWrapperStyle())) { method.annotate(new XmlListAnotator(method.getInterface())); } if (Constants.XSD_HEXBIN.equals(xmlSchema.getQName()) && (!part.isElement() || !method.isWrapperStyle())) { method.annotate(new XmlJavaTypeAdapterAnnotator(method.getInterface(), HexBinaryAdapter.class)); } }
&& el.getSchemaType() instanceof XmlSchemaSimpleType && ((XmlSchemaSimpleType)el.getSchemaType()). getContent() instanceof XmlSchemaSimpleTypeList) { mObj = Arrays.asList((Object[])mObj); writeObject(marshaller, source, newJAXBElement(elName, cls, mObj));
} else if (stype.getContent() instanceof XmlSchemaSimpleTypeRestriction) { corbaTypeImpl = processSimpleRestrictionType(stype, name, schematypeName, anonymous); } else if (stype.getContent() instanceof XmlSchemaSimpleTypeList) { XmlSchemaSimpleTypeList ltype = (XmlSchemaSimpleTypeList)stype.getContent(); CorbaType itemType = null; if (ltype.getItemType() != null) { itemType.getQName(), null, 0, false); } else if (stype.getContent() == null) {