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

How to use
TypeSchema
in
org.objectweb.celtix.configuration.impl

Best Java code snippets using org.objectweb.celtix.configuration.impl.TypeSchema (Showing top 14 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: org.objectweb.celtix/celtix-common

public Object unmarshal(QName type, Element data) throws JAXBException {
  return unmarshal(type, data, true);
}
origin: org.objectweb.celtix/celtix-common

public Object unmarshalDefaultValue(ConfigurationItemMetadata item, Element data) {
  return unmarshalDefaultValue(item, data, false);
}
origin: org.objectweb.celtix/celtix-common

public TypeSchema get(String namespaceURI, String base, String location) {
  TypeSchema ts = map.get(namespaceURI);
  if (null == ts) {
    ts = new TypeSchema(namespaceURI, base, location, forceDefaults);
    map.put(namespaceURI, ts);
  }
  return ts;
}

origin: org.objectweb.celtix/celtix-common

private void deserialize(Document document) {
  deseralizePackageName(document);
  deserializeTypes(document);
  deserializeElements(document);
}
origin: org.objectweb.celtix/celtix-common

InputSource is = getSchemaInputSource(baseURI, location);
deserialize(document);
origin: org.objectweb.celtix/celtix-common

private void deserializeTypes(Document document) {
  Element root = document.getDocumentElement();
  for (Node nd = root.getFirstChild(); nd != null; nd = nd.getNextSibling()) {
    if (Node.ELEMENT_NODE == nd.getNodeType()
      && ("simpleType".equals(nd.getLocalName()) || ("complexType".equals(nd.getLocalName())))) {
      String typeName = ((Element)nd).getAttribute("name");
      String baseType = null;
      if ("simpleType".equals(nd.getLocalName())) {
        baseType = getBaseType(document, typeName);
      }
      if (!typeDefinitions.containsKey(typeName)) {
        typeDefinitions.put(typeName, baseType);
        if (LOG.isLoggable(Level.FINE)) {
          LOG.fine("Added base type " + baseType + "  for key: " + typeName);
        }
      }
    }
  }
}
origin: org.objectweb.celtix/celtix-common

private String getBaseType(Document document, String typeName) {
  String currentType = typeName;
  QName baseType;
  do {
    baseType = getBaseTypeInternal(document, currentType);
    if (null == baseType) {
      LOG.severe(new Message("UNDEFINED_SIMPLE_TYPE_MSG", LOG, typeName).toString());
      return null;
    } else if (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(baseType.getNamespaceURI())) {
      if (LOG.isLoggable(Level.FINE)) {
        LOG.fine("Base type for " + typeName + ": " + baseType);
      }
      return baseType.getLocalPart();
    } else if (!namespaceURI.equals(baseType.getNamespaceURI())) {
      LOG.severe(new Message("SIMPLE_TYPE_DEFINED_IN_OTHER_NAMESPACE_MSG", LOG, typeName,
                  namespaceURI).toString());
      return null;
    }
    currentType = baseType.getLocalPart();
  } while (true);
}
origin: org.objectweb.celtix/celtix-common

QName type = null;
if (null != ts) {
  type = ts.getDeclaredType(elementName);
origin: org.objectweb.celtix/celtix-rt

  public Object getValue() {
    Object o = super.getValue();
    if (o instanceof Element) {
      Element el = (Element)o;
      QName type = new QName(el.getNamespaceURI(), el.getLocalName());
      TypeSchema ts = new TypeSchemaHelper(true).get(type.getNamespaceURI());
      if (null == ts) {
        throw new ConfigurationException(new Message("JAXB_PROPERTY_EDITOR_EXC", LOG, type));
      }
      try {
        return ts.unmarshal(type, el);
      } catch (JAXBException ex) {
        Message msg = new Message("JAXB_PROPERTY_EDITOR_EXC", LOG, type);
        throw new ConfigurationException(msg, ex);
      }
    }

    return o;
  }
}
origin: org.objectweb.celtix/celtix-common

  private void unmarshalDefaultValue(ConfigurationItemMetadataImpl item, Element data) {
    TypeSchema ts = new TypeSchemaHelper(forceDefaults).get(data.getNamespaceURI());
    Object obj = ts.unmarshalDefaultValue(item, data, doValidate);
    if (null != obj) {
      item.setDefaultValue(obj);
    }
  }
}
origin: org.objectweb.celtix/celtix-rt

public Object getValue() {
  Object o = super.getValue();
  if (o instanceof Element) {
    Element el = (Element)o;
    QName type = new QName(el.getNamespaceURI(), el.getLocalName());
    TypeSchema ts = new TypeSchemaHelper(true).get(type.getNamespaceURI());
    if (null == ts) {
      throw new ConfigurationException(new Message("JAXB_PROPERTY_EDITOR_EXC", LOG, type));
    }
    try {
      return ts.unmarshal(type, el);
    } catch (JAXBException ex) {
      Message msg = new Message("JAXB_PROPERTY_EDITOR_EXC", LOG, type);
      throw new ConfigurationException(msg, ex);
    }
  }
  return o;
}

origin: org.objectweb.celtix/celtix-rt

Object obj = ts.unmarshalDefaultValue(mdi, (Element)node, doValidate);
chains.add((HandlerChainType)obj);
origin: org.objectweb.celtix/celtix-common

public Object unmarshalDefaultValue(ConfigurationItemMetadata item, Element data, boolean doValidate) {
  try {
    return unmarshal(item.getType(), data, doValidate);
  } catch (JAXBException ex) {
    if (forceDefaults) {
      Message msg = new Message("DEFAULT_VALUE_UNMARSHAL_ERROR_EXC", LOG, item.getName());
      throw new ConfigurationException(msg, ex);
    }
    return null;
  }
}

origin: org.objectweb.celtix/celtix-rt

  public Object getValue() {
    Object o = super.getValue();
    if (o instanceof Element) {
      Element el = (Element)o;
      QName type = new QName(el.getNamespaceURI(), el.getLocalName());
      TypeSchema ts = new TypeSchemaHelper(true).get(type.getNamespaceURI());
      if (null == ts) {
        throw new ConfigurationException(new Message("JAXB_PROPERTY_EDITOR_EXC", LOG, type));
      }
      try {
        return ts.unmarshal(type, el);
      } catch (JAXBException ex) {
        Message msg = new Message("JAXB_PROPERTY_EDITOR_EXC", LOG, type);
        throw new ConfigurationException(msg, ex);
      }
    }

    return o;
  }       
}
org.objectweb.celtix.configuration.implTypeSchema

Most used methods

  • unmarshal
  • unmarshalDefaultValue
  • <init>
    prevent instantiation
  • deseralizePackageName
  • deserialize
  • deserializeElements
  • deserializeTypes
  • getBaseType
  • getBaseTypeInternal
  • getDeclaredType
  • getPackageName
  • getSchema
  • getPackageName,
  • getSchema,
  • getSchemaInputSource,
  • getXMLSchemaBaseType,
  • hasType

Popular in Java

  • Reactive rest calls using spring rest template
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • getContentResolver (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • JFrame (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
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