Codota Logo
XmlSchemaSimpleTypeRestriction
Code IndexAdd Codota to your IDE (free)

How to use
XmlSchemaSimpleTypeRestriction
in
org.apache.ws.commons.schema

Best Java code snippets using org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction (Showing top 20 results out of 315)

  • Common ways to obtain XmlSchemaSimpleTypeRestriction
private void myMethod () {
XmlSchemaSimpleTypeRestriction x =
  • Codota Iconnew XmlSchemaSimpleTypeRestriction()
  • Codota IconXmlSchemaSimpleType xmlSchemaSimpleType;(XmlSchemaSimpleTypeRestriction) xmlSchemaSimpleType.getContent()
  • Smart code suggestions by Codota
}
origin: apache/cxf

@Override
public void writeSchema(XmlSchema root) {
  XmlSchemaSimpleType simple = new XmlSchemaSimpleType(root, true);
  simple.setName(getSchemaType().getLocalPart());
  XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
  restriction.setBaseTypeName(Constants.XSD_STRING);
  simple.setContent(restriction);
  Object[] constants = getTypeClass().getEnumConstants();
  List<XmlSchemaFacet> facets = restriction.getFacets();
  for (Object constant : constants) {
    XmlSchemaEnumerationFacet f = new XmlSchemaEnumerationFacet();
    f.setValue(getValue(constant));
    facets.add(f);
  }
}
origin: apache/cxf

private boolean isEnumeration(XmlSchemaSimpleTypeRestriction restriction) {
  if ((restriction == null) || (restriction.getFacets().isEmpty())
    || (restriction.getBaseTypeName() == null)) {
    return false;
  }
  for (XmlSchemaFacet facet : restriction.getFacets()) {
    if (facet instanceof XmlSchemaEnumerationFacet) {
      return true;
    }
  }
  return false;
}
origin: org.apache.cxf/cxf-core

/**
 * 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;
}
origin: apache/cxf

  .getContent();
QName baseName = checkPrefix(restrictionType.getBaseTypeName());
for (XmlSchemaFacet val : restrictionType.getFacets()) {
  if (val instanceof XmlSchemaMaxLengthFacet) {
    maxLength = val.getValue().toString();
  corbaTypeImpl = createCorbaEnum(restrictionType, name, schematypeName);
} else {
  if (restrictionType.getBaseType() != null) {
    corbaTypeImpl = convertSchemaToCorbaType(restrictionType.getBaseType(), schematypeName,
                         stype, null, false);
  } else {
origin: org.apache.ws.schema/XmlSchema

  XmlSchema.SCHEMA_NS, "restriction")) != null) {
XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
  restriction.setAnnotation(restAnnotation);
origin: com.legsem.legstar/legstar-xsd2cob

if (restriction.getBaseType() == null) {
  typeName = restriction.getBaseTypeName();
  if (typeName != null) {
    if (XsdConstants.XSD_NS.equals(typeName
  return getPrimitiveType(schema, restriction.getBaseType());
origin: org.apache.axis2/axis2-jibx

XmlSchemaSimpleTypeContent content = stype.getContent();
if (content instanceof XmlSchemaSimpleTypeRestriction) {
  QName tname = ((XmlSchemaSimpleTypeRestriction)content).getBaseTypeName();
  if (SCHEMA_NAMESPACE.equals(tname.getNamespaceURI())) {
    format = (FormatElement)simpleTypeMap.get(tname);
origin: org.apache.cxf/cxf-api

/**
 * 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;
}
origin: com.legsem.legstar/legstar-xsd2cob

XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) xsdSimpleType
    .getContent();
if (restriction.getFacets() != null) {
  XmlSchemaObjectCollection collection = restriction.getFacets();
  for (Iterator < XmlSchemaObject > i = collection.getIterator(); i
      .hasNext();) {
if (restriction.getBaseType() == null) {
  QName typeName = restriction.getBaseTypeName();
  if (typeName != null
      && !XsdConstants.XSD_NS.equals(typeName
  getFacets(schema, restriction.getBaseType(), facets);
origin: org.apache.ws.commons.schema/XmlSchema

  XmlSchema.SCHEMA_NS, "restriction")) != null) {
XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
  restriction.setAnnotation(restAnnotation);
origin: apache/axis2-java

XmlSchemaSimpleTypeContent content = stype.getContent();
if (content instanceof XmlSchemaSimpleTypeRestriction) {
  QName tname = ((XmlSchemaSimpleTypeRestriction)content).getBaseTypeName();
  if (SCHEMA_NAMESPACE.equals(tname.getNamespaceURI())) {
    format = (FormatElement)simpleTypeMap.get(tname);
origin: org.apache.cxf/cxf-rt-databinding-aegis

@Override
public void writeSchema(XmlSchema root) {
  XmlSchemaSimpleType simple = new XmlSchemaSimpleType(root, true);
  simple.setName(getSchemaType().getLocalPart());
  XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
  restriction.setBaseTypeName(Constants.XSD_STRING);
  simple.setContent(restriction);
  Object[] constants = getTypeClass().getEnumConstants();
  List<XmlSchemaFacet> facets = restriction.getFacets();
  for (Object constant : constants) {
    XmlSchemaEnumerationFacet f = new XmlSchemaEnumerationFacet();
    f.setValue(getValue(constant));
    facets.add(f);
  }
}
origin: org.apache.openejb/openejb-axis

} else if (content instanceof XmlSchemaSimpleTypeRestriction) {
  final XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
  typeInfo.simpleBaseType = restriction.getBaseTypeName();
  for (final Iterator iterator = restriction.getFacets().getIterator(); iterator.hasNext(); ) {
    if (iterator.next() instanceof XmlSchemaEnumerationFacet) {
      typeInfo.enumType = true;
origin: org.apache.cxf/cxf-common-utilities

/**
 * 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;
}
origin: org.apache.ws/com.springsource.org.apache.ws.commons.schema

  new XmlSchemaSimpleTypeRestriction();
XmlSchemaAnnotation restAnnotation =
    handleAnnotation(restAnnotationEl);
restriction.setAnnotation(restAnnotation);
origin: raml-org/raml-java-parser

@Nonnull
protected XmlSchemaType createNumberSchemaType(NumberResolvedType numberTypeDefinition, QName baseType)
{
  final XmlSchemaSimpleType simpleType = new XmlSchemaSimpleType(schema, false);
  final XmlSchemaSimpleTypeRestriction content = new XmlSchemaSimpleTypeRestriction();
  content.setBaseTypeName(baseType);
  if (numberTypeDefinition.getMinimum() != null)
  {
    final XmlSchemaMinInclusiveFacet minLength = new XmlSchemaMinInclusiveFacet();
    minLength.setValue(numberTypeDefinition.getMinimum());
    content.getFacets().add(minLength);
  }
  if (numberTypeDefinition.getMaximum() != null)
  {
    final XmlSchemaMaxInclusiveFacet maxLength = new XmlSchemaMaxInclusiveFacet();
    maxLength.setValue(numberTypeDefinition.getMaximum());
    content.getFacets().add(maxLength);
  }
  simpleType.setContent(content);
  return simpleType;
}
origin: com.legsem.legstar/legstar-base-generator

XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) xsdSimpleType
    .getContent();
if (restriction != null && restriction.getBaseTypeName() != null) {
  QName xsdTypeName = restriction.getBaseTypeName();
  List < XmlSchemaFacet > facets = restriction.getFacets();
  if (xsdTypeName.equals(Constants.XSD_STRING)) {
    return getCobolAlphanumType(facets);
origin: apache/cxf

/**
 * 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;
}
origin: org.raml/raml-parser-2

@Nonnull
protected XmlSchemaType createNumberSchemaType(NumberResolvedType numberTypeDefinition, QName baseType)
{
  final XmlSchemaSimpleType simpleType = new XmlSchemaSimpleType(schema, false);
  final XmlSchemaSimpleTypeRestriction content = new XmlSchemaSimpleTypeRestriction();
  content.setBaseTypeName(baseType);
  if (numberTypeDefinition.getMinimum() != null)
  {
    final XmlSchemaMinInclusiveFacet minLength = new XmlSchemaMinInclusiveFacet();
    minLength.setValue(numberTypeDefinition.getMinimum());
    content.getFacets().add(minLength);
  }
  if (numberTypeDefinition.getMaximum() != null)
  {
    final XmlSchemaMaxInclusiveFacet maxLength = new XmlSchemaMaxInclusiveFacet();
    maxLength.setValue(numberTypeDefinition.getMaximum());
    content.getFacets().add(maxLength);
  }
  simpleType.setContent(content);
  return simpleType;
}
origin: com.legsem.legstar/legstar.avro.translator

XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) xsdType
    .getContent();
if (restriction != null && restriction.getBaseTypeName() != null) {
  QName xsdTypeName = restriction.getBaseTypeName();
    if (restriction.getFacets() == null) {
      throw new Xsd2AvroTranslatorException(
          "Binary type without facets in " + avroFieldName);
    avroType.put("type", "fixed");
    avroType.put("name", StringUtils.capitalize(avroFieldName));
    for (XmlSchemaObject facet : restriction.getFacets()) {
      if (facet instanceof XmlSchemaMaxLengthFacet) {
        XmlSchemaMaxLengthFacet xsef = (XmlSchemaMaxLengthFacet) facet;
    if (restriction.getFacets() == null) {
      throw new Xsd2AvroTranslatorException(
          "Decimal type without facets in " + avroFieldName);
    avroType.put("type", "bytes");
    avroType.put("logicalType", "decimal");
    for (XmlSchemaFacet facet : restriction.getFacets()) {
      if (facet instanceof XmlSchemaTotalDigitsFacet) {
        avroType.put("precision",
org.apache.ws.commons.schemaXmlSchemaSimpleTypeRestriction

Javadoc

Class for the restriction of simpleType elements. Represents the World Wide Web Consortium (W3C) restriction element for simple types.

Most used methods

  • getFacets
  • getBaseTypeName
  • <init>
    Creates new XmlSchemaSimpleTypeRestriction
  • setBaseTypeName
  • setAnnotation
  • getBaseType

Popular in Java

  • Running tasks concurrently on multiple threads
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • setContentView (Activity)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Table (org.hibernate.mapping)
    A relational table
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now