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

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

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

  • Common ways to obtain XmlSchemaAttribute
private void myMethod () {
XmlSchemaAttribute x =
  • Codota Iconnew XmlSchemaAttribute()
  • Smart code suggestions by Codota
}
origin: apache/cxf

private static void factorySetupType(XmlSchemaAttribute element, SchemaCollection schemaCollection,
                   AttributeInfo attributeInfo) {
  attributeInfo.type = element.getSchemaType();
  if (attributeInfo.type == null) {
    if (element.getSchemaTypeName().equals(Constants.XSD_ANYTYPE)) {
      attributeInfo.anyType = true;
    } else {
      attributeInfo.type = schemaCollection.getTypeByQName(element.getSchemaTypeName());
      if (attributeInfo.type == null
        && !element.getSchemaTypeName()
            .getNamespaceURI().equals(Constants.URI_2001_SCHEMA_XSD)) {
        JavascriptUtils.unsupportedConstruct("MISSING_TYPE", element.getSchemaTypeName()
            .toString(), element.getQName(), element);
      }
    }
  } else if (attributeInfo.type.getQName() != null
    && Constants.XSD_ANYTYPE.equals(attributeInfo.type.getQName())) {
    attributeInfo.anyType = true;
  }
}
origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core

/**
 * Adds the given parameter to the complex type.
 * @param complexType The complex type which the attribute will be added to
 * @param name The name of the attribute
 * @param xsdType The type of the attribute
 */
@SuppressWarnings("unchecked")
private static void addAttributeToComplexType(XmlSchemaComplexType complexType, String name,
    QName xsdType) {
  XmlSchemaAttribute attr = new XmlSchemaAttribute();
  attr.setName(name);
  attr.setSchemaTypeName(xsdType);
  attr.setUse(new XmlSchemaUse("optional"));
  XmlSchemaAttribute tmpAttr;
  for (Iterator<XmlSchemaAttribute> itr = complexType.getAttributes().getIterator(); 
       itr.hasNext();) {
    tmpAttr = itr.next();
    if (tmpAttr.getName().equals(attr.getName())) {
      /* current attribute is already set, nothing more to do */
      return;
    }
  }
  complexType.getAttributes().add(attr);
}
 
origin: apache/cxf

public static boolean isAttributeNameQualified(XmlSchemaAttribute attribute, XmlSchema schema) {
  if (attribute.isRef()) {
    throw new RuntimeException("isElementNameQualified on element with ref=");
  }
  if (attribute.getForm().equals(XmlSchemaForm.QUALIFIED)) {
    return true;
  }
  if (attribute.getForm().equals(XmlSchemaForm.UNQUALIFIED)) {
    return false;
  }
  return schema.getAttributeFormDefault().equals(XmlSchemaForm.QUALIFIED);
}
origin: apache/cxf

private boolean getAttributeQualification(XmlSchemaAttribute attr, String uri) {
  QName schemaName = attr.getQName();
  boolean qualified = false;
  if (attr.getForm() == XmlSchemaForm.QUALIFIED) {
    qualified = true;
  } else {
    qualified = WSDLUtils.isElementFormQualified(xmlSchemaList, schemaName);
  }
  return qualified;
}
origin: apache/cxf

/**
 * Obtain a suitable name for use in Javascript for an attribute. This function
 * is purely a tribute to the awful modularity of XmlSchema.
 * @param attribute
 * @param qualified
 * @return
 */
public String xmlAttributeString(XmlSchemaAttribute attribute, boolean qualified) {
  if (qualified) {
    // What if there were a prefix in the element's qname? This is not apparently
    // something that happens in this environment.
    String prefix = getPrefix(attribute.getQName().getNamespaceURI());
    collect(prefix, attribute.getQName().getNamespaceURI());
    return prefix + ":" + attribute.getName();
  }
  return attribute.getName(); // use the non-qualified name.
}
origin: apache/axis2-java

QName schemaTypeName = att.getSchemaTypeName();
if (schemaTypeName != null) {
  if (att.getWireName() != null) {
    if (baseSchemaTypeMap.containsKey(schemaTypeName)) {
      metainf.registerMapping(att.getWireName(), schemaTypeName,
                  baseSchemaTypeMap.get(schemaTypeName).toString(),
                  SchemaConstants.ATTRIBUTE_TYPE);
      String use = att.getUse().toString();
      if (USE_NONE.equals(use) || USE_OPTIONAL.equals(use)) {
        metainf.addtStatus(att.getWireName(), SchemaConstants.OPTIONAL_TYPE);
      att.addMetaInfo(
          SchemaConstants.SchemaCompilerInfoHolder.CLASSNAME_KEY,
          className);
      if (att.getDefaultValue() != null) {
        metainf.registerDefaultValue(att.getWireName(), att.getDefaultValue());
      if (att.getFixedValue() != null) {
        metainf.registerDefaultValue(att.getWireName(), att.getFixedValue());
        metainf.registerFixedQName(att.getWireName());
            metainf.registerMapping(att.getWireName(),
                        schemaTypeName,
                        processedTypemap.get(schemaTypeName).toString(),
                        SchemaConstants.ATTRIBUTE_TYPE);
origin: apache/cxf

private void addOneSchemaCrossImports(XmlSchema schema) {
  /*
   * We need to visit all the top-level items.
   */
  for (XmlSchemaElement element : schema.getElements().values()) {
    addElementCrossImportsElement(schema, element);
  }
  for (XmlSchemaAttribute attribute : schema.getAttributes().values()) {
    XmlSchemaUtils.addImportIfNeeded(schema, attribute.getRef().getTargetQName());
    XmlSchemaUtils.addImportIfNeeded(schema, attribute.getSchemaTypeName());
  }
  for (XmlSchemaType type : schema.getSchemaTypes().values()) {
    addCrossImportsType(schema, type);
  }
}
origin: apache/cxf

QName attrName = attribute.getQName();
if (attrName.getNamespaceURI().isEmpty()) {
  attrName = new QName(uri, attrName.getLocalPart());
if (attribute.getUse() == XmlSchemaUse.NONE
  || attribute.getUse() == XmlSchemaUse.OPTIONAL) {
  CorbaType attType = null;
  if (attribute.getSchemaType() != null) {
    attType = convertSchemaToCorbaType(attribute.getSchemaType(),
                      checkPrefix(attrName),
                      attribute.getSchemaType(),
                      null, true);
    if (attType != null) {
    attType = processPrimitiveType(attribute.getSchemaTypeName());
  if (attribute.getSchemaType() != null) {
    membertype = convertSchemaToCorbaType(attribute.getSchemaType(), attrName,
                       attribute.getSchemaType(), null, false);
  } else {
    membertype = processPrimitiveType(attribute.getSchemaTypeName());
origin: org.apache.cxf/cxf-api

                   XmlSchema localSchema,
                   XmlSchema attributeSchema) {
if (attribute.getQName() == null) {
  throw new RuntimeException("getSchemaQualifier on anonymous element.");
if (attribute.isRef()) {
  throw new RuntimeException("getSchemaQualified on the 'from' side of ref=.");
  return isAttributeNameQualified(attribute, attributeSchema)
    || (localSchema != null
      && !(attribute.getQName().getNamespaceURI().equals(localSchema.getTargetNamespace())));
} else {
  return isAttributeNameQualified(attribute, attributeSchema);
origin: org.apache.ws.commons.schema/XmlSchema

XmlSchemaAttribute attr = new XmlSchemaAttribute();
  XmlSchemaAnnotation annotation = handleAnnotation(annotationEl);
  attr.setAnnotation(annotation);
  attr.setUnhandledAttributes((Attr[]) attrs.toArray(new Attr[0]));
origin: raml-org/raml-java-parser

if (asBoolean(xmlFacets.getAttribute(), false))
  final XmlSchemaAttribute xmlSchemaAttribute = new XmlSchemaAttribute(schema, false);
  xmlSchemaAttribute.setName(name);
  final XmlSchemaType visit = valueResolvedType.visit(this);
  if (visit instanceof XmlSchemaSimpleType)
      xmlSchemaAttribute.setSchemaTypeName(visit.getQName());
      xmlSchemaAttribute.setSchemaType((XmlSchemaSimpleType) visit);
origin: org.apache.openejb/openejb-axis

if (item instanceof XmlSchemaAttribute) {
  final XmlSchemaAttribute attribute = (XmlSchemaAttribute) item;
  final Object old = typeInfo.attributes.put(attribute.getQName().getLocalPart(), attribute.getSchemaTypeName());
  if (old != null) {
    throw new IllegalArgumentException("Complain to your expert group member, spec does not support attributes with the same local name and differing namespaces: original: " + old + ", duplicate local name: " + attribute);
origin: apache/cxf

  String attributeNamespaceURI = attribute.getQName().getNamespaceURI();
  boolean attributeNoNamespace = "".equals(attributeNamespaceURI);
  attributeInfo.javascriptName = attribute.getQName().getLocalPart();
  attributeInfo.defaultValue = attribute.getDefaultValue();
  attributeInfo.fixedValue = attribute.getFixedValue();
  attributeInfo.use = attribute.getUse();
  factorySetupType(attribute, schemaCollection, attributeInfo);
} else { // any
origin: apache/cxf

XmlSchemaAttribute attribute = new XmlSchemaAttribute(root, false);
complex.getAttributes().add(attribute);
attribute.setName(name.getLocalPart());
AegisType type = getType(inf, name);
attribute.setSchemaTypeName(type.getSchemaType());
String ns = name.getNamespaceURI();
if (!ns.equals(root.getTargetNamespace())) {
origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core

sequenceDataAttr = (XmlSchemaAttribute) sequenceDataObject;
defGroup.addElementEntry(new StaticOutputElement(dataService,
    sequenceDataAttr.getName(), sequenceDataAttr
        .getName(), sequenceDataAttr.getName(),
    DBConstants.DBSFields.COLUMN,
    DBConstants.DBSFields.ATTRIBUTE, namespace,
    sequenceDataAttr.getSchemaTypeName(),
    new HashSet<String>(), DBConstants.DataCategory.VALUE,
    DBConstants.ResultTypes.XML, null, ParamValue.PARAM_VALUE_SCALAR, null));
origin: apache/cxf

private void addCrossImportsAttributeList(XmlSchema schema, List<XmlSchemaAttributeOrGroupRef> list) {
  for (XmlSchemaAttributeOrGroupRef attr : list) {
    QName ref = null;
    if (attr instanceof XmlSchemaAttribute) {
      ref = ((XmlSchemaAttribute)attr).getRef().getTargetQName();
    } else {
      XmlSchemaAttributeGroupRef groupRef = (XmlSchemaAttributeGroupRef)attr;
      ref = groupRef.getRef().getTargetQName();
    }
    if (ref != null) {
      XmlSchemaUtils.addImportIfNeeded(schema, ref);
    }
  }
}
origin: apache/cxf

attributeInfo.use = attribute.getUse();
if (attribute.getRef().getTarget() != null) {
  realAnnotated = attribute.getRef().getTarget();
  attributeInfo.global = true;
origin: org.apache.axis2/axis2-adb-codegen

private static void processAttributes(XmlSchemaComplexType complexType,
                String opName,
                String qnameSuffix,
                TypeMapper typeMap) {
  for (XmlSchemaObject item : complexType.getAttributes()) {
    XmlSchemaAttribute xmlSchemaAttribute;
    if (item instanceof XmlSchemaAttribute) {
      xmlSchemaAttribute = (XmlSchemaAttribute) item;
      populateClassName(xmlSchemaAttribute.getMetaInfoMap(),
          typeMap,
          opName,
          false,
          xmlSchemaAttribute.getName(),
          qnameSuffix);
    }
  }
}
origin: org.apache.ws.commons.schema/XmlSchema

Attr[] unhandled = attributeObj.getUnhandledAttributes();
origin: org.apache.openejb/openejb-axis

if (item instanceof XmlSchemaAttribute) {
  final XmlSchemaAttribute attribute = (XmlSchemaAttribute) item;
  if (attribute.getRefName().equals(SOAP_ARRAY_TYPE)) {
    for (final Attr attr : attribute.getUnhandledAttributes()) {
      final QName attQName = new QName(attr.getNamespaceURI(), attr.getLocalName());
      if (WSDL_ARRAY_TYPE.equals(attQName)) {
org.apache.ws.commons.schemaXmlSchemaAttribute

Javadoc

Class for attribute types. Represents the World Wide Web Consortium (W3C) attribute element.

Most used methods

  • getSchemaTypeName
  • getQName
  • <init>
  • getRef
  • getForm
  • getName
  • getUnhandledAttributes
  • isRef
  • getSchemaType
  • getUse
  • setAnnotation
  • setName
  • setAnnotation,
  • setName,
  • setSchemaTypeName,
  • setUnhandledAttributes,
  • getDefaultValue,
  • getFixedValue,
  • addMetaInfo,
  • getMetaInfoMap,
  • getRefName,
  • getWireName

Popular in Java

  • Reactive rest calls using spring rest template
  • addToBackStack (FragmentTransaction)
  • getSystemService (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
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