gpt4 book ai didi

org.apache.xmlbeans.impl.values.XmlObjectBase.schemaType()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 02:29:05 25 4
gpt4 key购买 nike

本文整理了Java中org.apache.xmlbeans.impl.values.XmlObjectBase.schemaType()方法的一些代码示例,展示了XmlObjectBase.schemaType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlObjectBase.schemaType()方法的具体详情如下:
包路径:org.apache.xmlbeans.impl.values.XmlObjectBase
类名称:XmlObjectBase
方法名:schemaType

XmlObjectBase.schemaType介绍

暂无

代码示例

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

public SchemaType get_schema_type()
{
  return schemaType();
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

public final boolean uses_invalidate_value()
{
  SchemaType type = schemaType();
  return type.isSimpleType() || type.getContentType() == SchemaType.SIMPLE_CONTENT;
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/**
 * Returns false if child elements are insensitive to order;
 * if it returns true, you're required to call invalidate_element_order
 * on children to the right of any child order rearrangement.
 */
public boolean is_child_element_order_sensitive()
{
  if (!_isComplexType())
    return false;
  return schemaType().isOrderSensitive();
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

public SchemaField get_attribute_field(QName attrName)
{
  SchemaAttributeModel model = schemaType().getAttributeModel();
  if (model == null)
    return null;
  return model.getAttribute(attrName);
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

private final String getPrimitiveTypeName()
{
  SchemaType type = schemaType();
  if (type.isNoType())
    return "unknown";
  SchemaType t = type.getPrimitiveType();
  if (t == null)
    return "complex";
  else
    return t.getName().getLocalPart();
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

public SchemaType instanceType()
  { synchronized (monitor()) { return isNil() ? null : schemaType(); } }

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

public SchemaType get_element_type(QName eltName, QName xsiType)
{
  return schemaType().getElementType(
    eltName, xsiType, get_store().get_schematypeloader() );
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/**
 * A typestore user can return a visitor that is used to compute
 * default text and elementflags for an arbitrary element.
 */
public TypeStoreVisitor new_visitor()
{
  if (!_isComplexContent())
    return null;
  return new SchemaTypeVisitorImpl(schemaType().getContentModel());
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/**
 * A typestore user can create a new TypeStoreUser instance for
 * a given attribute child, based on the attribute name.
 *
 * Returns null if there is no strongly typed information for that
 * given attributes.
 */
public TypeStoreUser create_attribute_user(QName attrName)
{
  return (TypeStoreUser)((SchemaTypeImpl)schemaType()).createAttributeType(attrName, get_store().get_schematypeloader());
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

public SchemaType get_attribute_type(QName attrName)
{
  return schemaType().getAttributeType(
    attrName, get_store().get_schematypeloader() );
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

private SchemaField schemaField() {
  SchemaType st = schemaType();
  SchemaField field;
  // First check if this field has an anonymous type
  field = st.getContainerField();
  if (field == null)
    field = get_store().get_schema_field();
  return field;
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/**
 * Returns the default attribute text for the attribute with
 * the given name, or null if no default.
 */
public String get_default_attribute_text(QName attrName)
{
  assert(_isComplexType());
  if (!_isComplexType())
    throw new IllegalStateException();
  SchemaProperty prop = schemaType().getAttributeProperty(attrName);
  if (prop == null)
    return "";
  return prop.getDefaultText();
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/**
   * Called by code generated code to get the default attribute value
   * for a given attribute name, or null if none.
   */
  protected XmlAnySimpleType get_default_attribute_value(QName name)
  {
    SchemaType sType = schemaType();
    SchemaAttributeModel aModel = sType.getAttributeModel();
    if (aModel == null)
      return null;
    SchemaLocalAttribute sAttr = aModel.getAttribute(name);
    if (sAttr == null)
      return null;
    return sAttr.getDefaultValue();
  }
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/**
 * Returns the default element text, if it's consistent. If it's
 * not consistent, returns null, and requires a visitor walk.
 *
 * Also returns null if there is no default at all (although
 * that can also be discovered via get_elementflags without
 * doing a walk).
 */
public String get_default_element_text(QName eltName)
{
  assert(_isComplexContent());
  if (!_isComplexContent())
    throw new IllegalStateException();
  SchemaProperty prop = schemaType().getElementProperty(eltName);
  if (prop == null)
    return "";
  return prop.getDefaultText();
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/**
 * Returns the flags for the given attribute.
 */
public int get_attributeflags(QName attrName)
{
  if (!_isComplexType())
    return 0;
  SchemaProperty prop = schemaType().getAttributeProperty(attrName);
  if (prop == null)
    return 0;
  return
    (prop.hasDefault() == SchemaProperty.NEVER ? 0 : TypeStore.HASDEFAULT) |
    (prop.hasFixed() == SchemaProperty.NEVER ? 0 : TypeStore.FIXED);
  // BUGBUG: todo: hook up required?
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/**
 * Same as copy() but unsynchronized.
 * If Locale.COPY_USE_NEW_LOCALE is set in the options, a new locale will be created for the copy.
 * Warning: Using this method in mutithreaded environment can cause invalid states.
 */
public final XmlObject _copy(XmlOptions xmlOptions)
{
  // immutable objects don't get copied. They're immutable
  if (isImmutable())
    return this;
  check_orphaned();
  SchemaTypeLoader stl = get_store().get_schematypeloader();
  XmlObject result = (XmlObject)get_store().copy(stl, schemaType(), xmlOptions);
  return result;
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

private TypeStoreUser setterHelper ( XmlObjectBase src )
{
  check_orphaned();
  src.check_orphaned();
  return
    get_store().copy_contents_from( src.get_store() ).
      get_store().change_type( src.schemaType() );
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

private TypeStoreUser objSetterHelper(XmlObjectBase srcObj, QName propName, int index, short kindSetterHelper)
{
  XmlObjectBase target = getTargetForSetter(propName, index, kindSetterHelper);
  target.check_orphaned();
  srcObj.check_orphaned();
  return target.get_store().copy_contents_from( srcObj.get_store() ).
      get_store().change_type( srcObj.schemaType() );
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

/**
 * Returns the elementflags, if they're consistent. If they're
 * not, returns -1, and requires a vistor walk.
 */
public int get_elementflags(QName eltName)
{
  if (!_isComplexContent())
    return 0;
  SchemaProperty prop = schemaType().getElementProperty(eltName);
  if (prop == null)
    return 0;
  if (prop.hasDefault() == SchemaProperty.VARIABLE ||
    prop.hasFixed() == SchemaProperty.VARIABLE ||
    prop.hasNillable() == SchemaProperty.VARIABLE)
    return -1;
  return
    (prop.hasDefault() == SchemaProperty.NEVER ? 0 : TypeStore.HASDEFAULT) |
    (prop.hasFixed() == SchemaProperty.NEVER ? 0 : TypeStore.FIXED) |
    (prop.hasNillable() == SchemaProperty.NEVER ? 0 : TypeStore.NILLABLE);
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

private XmlObject ensureStore()
{
  if ((_flags & FLAG_STORE) != 0)
    return this;
  check_dated();
  String value =
    (_flags & FLAG_NIL) != 0
      ? ""
      : compute_text( has_store() ? get_store() : null );
  XmlOptions options = new XmlOptions().setDocumentType(schemaType());
  XmlObject x = XmlObject.Factory.newInstance( options );
  XmlCursor c = x.newCursor();
  c.toNextToken();
  c.insertChars( value );
  return x;
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com