org.eclipse.xsd.XSDParticle.getMaxOccurs()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(83)

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

XSDParticle.getMaxOccurs介绍

[英]Returns the value of the 'Max Occurs' attribute. The default value is "1".

This represents the max occurs infoset property. The unbounded value is represented by #UNBOUNDED, i.e., -1.
[中]返回“Max Occurs”属性的值。默认值为[$0$]。
这表示max occursinfoset属性。unbounded值由#UNBOUNDED表示,即-1

代码示例

代码示例来源:origin: geoserver/geoserver

XSDParticle part = (XSDParticle) ce.getContainer();
at.setMinOccurs(part.getMinOccurs());
at.setMaxOccurs(part.getMaxOccurs());

代码示例来源:origin: geotools/geotools

public void visit(XSDParticle particle) {
    XSDElementDeclaration decl = (XSDElementDeclaration) particle.getContent();
    if (decl.isElementDeclarationReference()) {
      decl = decl.getResolvedElementDeclaration();
    }
    if (decl == fElement) {
      if (particle.isSetMaxOccurs()) {
        maxOccurs.add(Integer.valueOf(particle.getMaxOccurs()));
      } else if (particle.getContainer() instanceof XSDModelGroup
          && particle.getContainer().getContainer()
              instanceof XSDParticle) {
        particle = (XSDParticle) particle.getContainer().getContainer();
        maxOccurs.add(Integer.valueOf(particle.getMaxOccurs()));
      } else {
        maxOccurs.add(1);
      }
    }
  }
};

代码示例来源:origin: geotools/geotools

maxOccurs = particle.getMaxOccurs();
} else {
        maxOccurs = cParticle.getMaxOccurs();

代码示例来源:origin: geotools/geotools

particle.setMaxOccurs(reference.getMaxOccurs());
} else {

代码示例来源:origin: geotools/geotools

int max = particle.getMaxOccurs();

代码示例来源:origin: geotools/geotools

int maxOccurs = particle.getMaxOccurs();
if (maxOccurs == -1) {
  maxOccurs = Integer.MAX_VALUE;

代码示例来源:origin: geotools/geotools

substitutedChildParticle.setMaxOccurs(childParticle.getMaxOccurs());
substitutedChildParticle.setMinOccurs(childParticle.getMinOccurs());
XSDElementDeclaration wrapper =

代码示例来源:origin: geotools/geotools

int maxOccurs = particle.getMaxOccurs();
if (maxOccurs == -1) {
  maxOccurs = Integer.MAX_VALUE;

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

public void visit(XSDParticle particle) {
    XSDElementDeclaration decl = (XSDElementDeclaration) particle.getContent();
    if (decl.isElementDeclarationReference()) {
      decl = decl.getResolvedElementDeclaration();
    }
    if (decl == fElement) {
      maxOccurs.add(new Integer(particle.getMaxOccurs()));
    }
  }
};

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

public void visit(XSDParticle particle) {
    XSDElementDeclaration decl = (XSDElementDeclaration) particle.getContent();
    if (decl.isElementDeclarationReference()) {
      decl = decl.getResolvedElementDeclaration();
    }
    if (decl == fElement) {
      maxOccurs.add(new Integer(particle.getMaxOccurs()));
    }
  }
};

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

@Override
public String getText(Object object)
{
 XSDParticle xsdParticle = ((XSDParticle)object);
 XSDParticleContent xsdParticleContent = getDelegate(xsdParticle);
 if (xsdParticleContent != null)
 {
  return itemDelegator.getText(xsdParticleContent);
 }
 else
 {
  return
   xsdParticle.getMinOccurs() +
   ".." +
   (xsdParticle.getMaxOccurs() == -1 ? "unbounded" : Integer.toString(xsdParticle.getMaxOccurs()));
 }
}

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

public static int getMaxOccurs(XSDConcreteComponent component)
{
 int maxOccur = -2;
 if (component != null)
 {
  Object o = component.getContainer();
  if (o instanceof XSDParticle)
  {
   if (((XSDParticle) o).isSetMaxOccurs())
   {
    try
    {
     maxOccur = ((XSDParticle) o).getMaxOccurs();
    }
    catch (Exception e)
    {
    }
   }
  }
 }
 return maxOccur;
}

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

int max = ((XSDParticle) xsdWildcard.getContainer()).getMaxOccurs();
result.append(".."); //$NON-NLS-1$
if (max == XSDParticle.UNBOUNDED)
int max = ((XSDParticle) xsdWildcard.getContainer()).getMaxOccurs();
result.append(String.valueOf(max));

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

@Override
protected void patch()
{
 super.patch();
 List<XSDParticle> newParticles = new ArrayList<XSDParticle>(getContents());
 Collection<XSDParticle> remainingParticles = new ArrayList<XSDParticle>(getParticles());
 for (ListIterator<XSDParticle> particles = newParticles.listIterator(); particles.hasNext(); )
 {
  XSDParticle xsdParticle = particles.next();
  if (xsdParticle.getMaxOccurs() == 0)
  {
   particles.remove();
   remainingParticles.add(xsdParticle);
  }
  else
  {
   remainingParticles.remove(xsdParticle);
  }
 }
 if (!remainingParticles.isEmpty())
 {
  getParticles().removeAll(remainingParticles);
 }
 setListContentAndOrder(getParticles(), newParticles);
}

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

@Override
protected void patch()
{
 super.patch();
 List<XSDParticle> newParticles = new ArrayList<XSDParticle>(getContents());
 Collection<XSDParticle> remainingParticles = new ArrayList<XSDParticle>(getParticles());
 for (ListIterator<XSDParticle> particles = newParticles.listIterator(); particles.hasNext(); )
 {
  XSDParticle xsdParticle = particles.next();
  if (xsdParticle.getMaxOccurs() == 0)
  {
   particles.remove();
   remainingParticles.add(xsdParticle);
  }
  else
  {
   remainingParticles.remove(xsdParticle);
  }
 }
 if (!remainingParticles.isEmpty())
 {
  getParticles().removeAll(remainingParticles);
 }
 setListContentAndOrder(getParticles(), newParticles);
}

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

public void execute()
{
try
{
 Element element = particle.getElement();
 beginRecording(element);
 String currentMax = element.getAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
 removeMaxOccursAttribute = (currentMax == null)? true: false;
   oldMaxOccurs = particle.getMaxOccurs();
   particle.setMaxOccurs(newMaxOccurs);
}
finally
{
 endRecording();
}
}

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

int max = ((XSDParticle) xsdModelGroup.getContainer()).getMaxOccurs();
result.append(".."); //$NON-NLS-1$
if (max == XSDParticle.UNBOUNDED)
int max = ((XSDParticle) xsdModelGroup.getContainer()).getMaxOccurs();
result.append(String.valueOf(max));

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

return getComponentLabel(xsdParticle.getTerm()) + "[" + xsdParticle.getMinOccurs() + "," + xsdParticle.getMaxOccurs() + "]";

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

return getComponentLabel(xsdParticle.getTerm()) + "[" + xsdParticle.getMinOccurs() + "," + xsdParticle.getMaxOccurs() + "]";

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

particle.setMaxOccurs(parentParticle.getMaxOccurs());
parentParticle.unsetMaxOccurs();

相关文章