gpt4 book ai didi

org.eclipse.xsd.XSDEnumerationFacet类的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 04:27:05 26 4
gpt4 key购买 nike

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

XSDEnumerationFacet介绍

[英]A representation of the model object 'Enumeration Facet'.

The following features are supported:

  • org.eclipse.xsd.XSDEnumerationFacet#getValue
    [中]模型对象Enumeration Facet的表示形式。
    支持以下功能:
    *组织。日食xsd。XsdeNumerationFact#getValue

代码示例

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

@Override
public Object caseXSDEnumerationFacet(XSDEnumerationFacet xsdEnumerationFacet)
 List<?> values = xsdEnumerationFacet.getValue();
 if (!values.isEmpty())
  String lexicalValue= xsdSimpleTypeDefinition.getNormalizedLiteral(xsdEnumerationFacet.getLexicalValue());
  Object value = values.get(0);
  if (value instanceof List<?>)

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

public static XSDEnumerationFacet createEnumerationFacet(Node node)
{
 if (XSDConstants.nodeType(node) == XSDConstants.ENUMERATION_ELEMENT)
 {
  XSDEnumerationFacet xsdEnumerationFacet = XSDFactory.eINSTANCE.createXSDEnumerationFacet();
  xsdEnumerationFacet.setElement((Element)node);
  return xsdEnumerationFacet;
 }
 return null;
}

代码示例来源:origin: org.eclipse/org.eclipse.xsd

newValue.addAll(enumerationFacet.getValue());
XSDAnnotation xsdAnnotation = enumerationFacet.getAnnotation();
if (xsdAnnotation != null)
newLexicalValue.append(enumerationFacet.getLexicalValue());

代码示例来源:origin: org.eclipse.emf/org.eclipse.xsd.edit

@Override
public String getText(Object object)
{
 XSDEnumerationFacet xsdEnumerationFacet = ((XSDEnumerationFacet)object);
 String result = xsdEnumerationFacet.getLexicalValue();
 return result == null ? "" : result;
}

代码示例来源:origin: org.eclipse/org.eclipse.xsd

protected void initialize(EAttribute eAttribute, XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
{
 if (XSDConstants.isOrIsDerivedFromID(xsdSimpleTypeDefinition))
 {
  eAttribute.setID(true);
 }
 // If there is no default value but the type has enumeration facets and the value is a primitive...
 //
 if (!eAttribute.isMany() &&
    eAttribute.getDefaultValueLiteral() == null &&
    xsdSimpleTypeDefinition != null &&
    xsdSimpleTypeDefinition.getEffectiveEnumerationFacet() != null &&
    eAttribute.getEType().getDefaultValue() != null)
 {
  // Set the default to the first enumeration's value.
  //
  eAttribute.setDefaultValueLiteral
   ((xsdSimpleTypeDefinition.
     getEffectiveEnumerationFacet().
     getSimpleTypeDefinition().
     getEnumerationFacets().
     get(0)).getLexicalValue());
 }
}

代码示例来源:origin: org.geotools/gt2-xml-core

XSDEnumerationFacet enumeration = (XSDEnumerationFacet) e.next();
for (Iterator v = enumeration.getValue().iterator(); v.hasNext();) {
  values.add(v.next());

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public void execute()
 {
  try
  {
   beginRecording(simpleType.getElement());
   XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
   XSDEnumerationFacet enumerationFacet = factory.createXSDEnumerationFacet();
   enumerationFacet.setLexicalValue(value);
   simpleType.getFacetContents().add(enumerationFacet);
   formatChild(simpleType.getElement());
  }
  finally
  {
   endRecording();
  }
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

enumerationFacet.getSimpleTypeDefinition().getFacetContents().remove(enumerationFacet);

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

XSDAnnotation xsdAnnotation = enumerationFacet.getAnnotation();
if (xsdAnnotation != null)
if (newValue.addAll(enumerationFacet.getValue()))
 newLexicalValue.append(enumerationFacet.getLexicalValue());

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public Object getValue(Object element, String property)
{
 if (element instanceof XSDEnumerationFacet)
 {
  XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) element;
  String value = enumFacet.getLexicalValue();
  if (value == null)
   value = ""; //$NON-NLS-1$
  return value;
 }
 return ""; //$NON-NLS-1$
}

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

protected void initialize(EAttribute eAttribute, XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
{
 if (XSDConstants.isOrIsDerivedFromID(xsdSimpleTypeDefinition))
 {
  eAttribute.setID(true);
 }
 // If there is no default value but the type has enumeration facets and the value is a primitive...
 //
 if (!eAttribute.isMany() &&
    eAttribute.getDefaultValueLiteral() == null &&
    xsdSimpleTypeDefinition != null &&
    xsdSimpleTypeDefinition.getEffectiveEnumerationFacet() != null &&
    eAttribute.getEType().getDefaultValue() != null &&
    !(eAttribute.getEType() instanceof EEnum))
 {
  // Set the default to the first enumeration's value.
  //
  setDefaultValueLiteral
   (eAttribute,
    xsdSimpleTypeDefinition.getNormalizedLiteral
    ((xsdSimpleTypeDefinition.
      getEffectiveEnumerationFacet().
      getSimpleTypeDefinition().
      getEnumerationFacets().
      get(0)).getLexicalValue()));
 }
}

代码示例来源:origin: org.geotools.xsd/gt-core

XSDEnumerationFacet enumeration = (XSDEnumerationFacet) e.next();
for (Iterator v = enumeration.getValue().iterator(); v.hasNext();) {
  values.add(v.next());

代码示例来源:origin: org.eclipse/org.eclipse.xsd

/**
 * Each EEnum is mapped to a schema simple type that restricts the string simple type;
 * the schema type has an enumeration facet for each EEnumLiteral.
 */
protected void processEnum(EEnum eEnum)
{
 XSDSimpleTypeDefinition enumType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
 enumType.setName(getName(eEnum));
 enumType.setBaseTypeDefinition(xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("NCName"));
 xsdSchema.getContents().add(enumType);
 map(enumType, eEnum);
 for (EEnumLiteral literal : eEnum.getELiterals())
 {
  XSDEnumerationFacet facet = XSDFactory.eINSTANCE.createXSDEnumerationFacet();
  facet.setLexicalValue(getName(literal));
  enumType.getFacetContents().add(facet);
  map(facet, literal);
 }
}

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

for (Object enumerator : xsdSimpleTypeDefinition.getEffectiveEnumerationFacet().getValue())
 if (!"true".equalsIgnoreCase(getEcoreAttribute(xsdEnumerationFacet, "ignore")))
  String literal = xsdSimpleTypeDefinition.getNormalizedLiteral(xsdEnumerationFacet.getLexicalValue());
  if (literal != null && eEnum.getEEnumLiteralByLiteral(literal) == null)

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public String getColumnText(Object element, int columnIndex)
{
 if (element instanceof XSDEnumerationFacet)
 {
  XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) element;
  String value = enumFacet.getLexicalValue();
  if (value == null)
   value = ""; //$NON-NLS-1$
  return value;
 }
 return ""; //$NON-NLS-1$
}

代码示例来源:origin: org.geotools/gt2-xml-xsd

for ( Iterator e = type.getEnumerationFacets().iterator(); e.hasNext(); ) {
  XSDEnumerationFacet enumeration = (XSDEnumerationFacet) e.next();
  for ( Iterator v = enumeration.getValue().iterator(); v.hasNext(); ) {
    values.add( v.next() );

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

/**
 * Each EEnum is mapped to a schema simple type that restricts the string simple type;
 * the schema type has an enumeration facet for each EEnumLiteral.
 */
protected void processEnum(EEnum eEnum)
{
 XSDSimpleTypeDefinition enumType = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
 enumType.setName(getName(eEnum));
 enumType.setBaseTypeDefinition(xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("NCName"));
 xsdSchema.getContents().add(enumType);
 map(enumType, eEnum);
 for (EEnumLiteral literal : eEnum.getELiterals())
 {
  XSDEnumerationFacet facet = XSDFactory.eINSTANCE.createXSDEnumerationFacet();
  facet.setLexicalValue(getName(literal));
  enumType.getFacetContents().add(facet);
  map(facet, literal);
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.xsd

public static XSDEnumerationFacet createEnumerationFacet(Node node)
{
 if (XSDConstants.nodeType(node) == XSDConstants.ENUMERATION_ELEMENT)
 {
  XSDEnumerationFacet xsdEnumerationFacet = XSDFactory.eINSTANCE.createXSDEnumerationFacet();
  xsdEnumerationFacet.setElement((Element)node);
  return xsdEnumerationFacet;
 }
 return null;
}

代码示例来源:origin: org.eclipse/org.eclipse.xsd

@Override
public Object caseXSDEnumerationFacet(XSDEnumerationFacet xsdEnumerationFacet)
{
 enumeration.add(xsdEnumerationFacet.getLexicalValue());
 return this;
}

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

xsdEnumerationFacet./*{@link XSDConstrainingFacet#setLexicalValue */setLexicalValue/*}*/("unknown");
firstMemberTypeDefinition./*{@link XSDSimpleTypeDefinition#getFacetContents */getFacetContents/*}*/().add(xsdEnumerationFacet);

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