本文整理了Java中org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction.getFacets()
方法的一些代码示例,展示了XmlSchemaSimpleTypeRestriction.getFacets()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlSchemaSimpleTypeRestriction.getFacets()
方法的具体详情如下:
包路径:org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction
类名称:XmlSchemaSimpleTypeRestriction
方法名:getFacets
暂无
代码示例来源:origin: apache/cxf
private boolean isEnumeration(XmlSchemaSimpleTypeRestriction restriction) {
if ((restriction == null) || (restriction.getFacets().isEmpty())
|| (restriction.getBaseTypeName() == null)) {
return false;
}
for (XmlSchemaFacet facet : restriction.getFacets()) {
if (facet instanceof XmlSchemaEnumerationFacet) {
return true;
}
}
return false;
}
代码示例来源:origin: org.apache.cxf/cxf-core
/**
* Return true if a simple type is a straightforward XML Schema representation of an enumeration.
* If we discover schemas that are 'enum-like' with more complex structures, we might
* make this deal with them.
* @param type Simple type, possible an enumeration.
* @return true for an enumeration.
*/
public static boolean isEumeration(XmlSchemaSimpleType type) {
XmlSchemaSimpleTypeContent cOntent= type.getContent();
if (!(content instanceof XmlSchemaSimpleTypeRestriction)) {
return false;
}
XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
List
for (XmlSchemaFacet facet : facets) {
if (!(facet instanceof XmlSchemaEnumerationFacet)) {
return false;
}
}
return true;
}
代码示例来源:origin: org.apache.cxf/cxf-api
/**
* Return true if a simple type is a straightforward XML Schema representation of an enumeration.
* If we discover schemas that are 'enum-like' with more complex structures, we might
* make this deal with them.
* @param type Simple type, possible an enumeration.
* @return true for an enumeration.
*/
public static boolean isEumeration(XmlSchemaSimpleType type) {
XmlSchemaSimpleTypeContent cOntent= type.getContent();
if (!(content instanceof XmlSchemaSimpleTypeRestriction)) {
return false;
}
XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
List
for (XmlSchemaFacet facet : facets) {
if (!(facet instanceof XmlSchemaEnumerationFacet)) {
return false;
}
}
return true;
}
代码示例来源:origin: org.apache.cxf/cxf-common-utilities
/**
* Return true if a simple type is a straightforward XML Schema representation of an enumeration.
* If we discover schemas that are 'enum-like' with more complex structures, we might
* make this deal with them.
* @param type Simple type, possible an enumeration.
* @return true for an enumeration.
*/
public static boolean isEumeration(XmlSchemaSimpleType type) {
XmlSchemaSimpleTypeContent cOntent= type.getContent();
if (!(content instanceof XmlSchemaSimpleTypeRestriction)) {
return false;
}
XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
List
for (XmlSchemaFacet facet : facets) {
if (!(facet instanceof XmlSchemaEnumerationFacet)) {
return false;
}
}
return true;
}
代码示例来源:origin: apache/cxf
/**
* Return true if a simple type is a straightforward XML Schema representation of an enumeration.
* If we discover schemas that are 'enum-like' with more complex structures, we might
* make this deal with them.
* @param type Simple type, possible an enumeration.
* @return true for an enumeration.
*/
public static boolean isEumeration(XmlSchemaSimpleType type) {
XmlSchemaSimpleTypeContent cOntent= type.getContent();
if (!(content instanceof XmlSchemaSimpleTypeRestriction)) {
return false;
}
XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
List
for (XmlSchemaFacet facet : facets) {
if (!(facet instanceof XmlSchemaEnumerationFacet)) {
return false;
}
}
return true;
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
/**
* Return true if a simple type is a straightforward XML Schema representation of an enumeration.
* If we discover schemas that are 'enum-like' with more complex structures, we might
* make this deal with them.
* @param type Simple type, possible an enumeration.
* @return true for an enumeration.
*/
public static boolean isEumeration(XmlSchemaSimpleType type) {
XmlSchemaSimpleTypeContent cOntent= type.getContent();
if (!(content instanceof XmlSchemaSimpleTypeRestriction)) {
return false;
}
XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
List
for (XmlSchemaFacet facet : facets) {
if (!(facet instanceof XmlSchemaEnumerationFacet)) {
return false;
}
}
return true;
}
代码示例来源:origin: apache/cxf
/**
* Retrieve the string values for an enumeration.
* @param type
*/
public static List
XmlSchemaSimpleTypeContent cOntent= type.getContent();
XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
List
List
for (XmlSchemaFacet facet : facets) {
XmlSchemaEnumerationFacet enumFacet = (XmlSchemaEnumerationFacet) facet;
values.add(enumFacet.getValue().toString());
}
return values;
}
代码示例来源:origin: org.apache.cxf/cxf-core
/**
* Retrieve the string values for an enumeration.
* @param type
*/
public static List
XmlSchemaSimpleTypeContent cOntent= type.getContent();
XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
List
List
for (XmlSchemaFacet facet : facets) {
XmlSchemaEnumerationFacet enumFacet = (XmlSchemaEnumerationFacet) facet;
values.add(enumFacet.getValue().toString());
}
return values;
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
/**
* Retrieve the string values for an enumeration.
* @param type
*/
public static List
XmlSchemaSimpleTypeContent cOntent= type.getContent();
XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
List
List
for (XmlSchemaFacet facet : facets) {
XmlSchemaEnumerationFacet enumFacet = (XmlSchemaEnumerationFacet) facet;
values.add(enumFacet.getValue().toString());
}
return values;
}
代码示例来源:origin: org.apache.cxf/cxf-api
/**
* Retrieve the string values for an enumeration.
* @param type
*/
public static List
XmlSchemaSimpleTypeContent cOntent= type.getContent();
XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
List
List
for (XmlSchemaFacet facet : facets) {
XmlSchemaEnumerationFacet enumFacet = (XmlSchemaEnumerationFacet) facet;
values.add(enumFacet.getValue().toString());
}
return values;
}
代码示例来源:origin: org.apache.cxf/cxf-common-utilities
/**
* Retrieve the string values for an enumeration.
* @param type
* @return
*/
public static List
XmlSchemaSimpleTypeContent cOntent= type.getContent();
XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
List
List
for (XmlSchemaFacet facet : facets) {
XmlSchemaEnumerationFacet enumFacet = (XmlSchemaEnumerationFacet) facet;
values.add(enumFacet.getValue().toString());
}
return values;
}
代码示例来源:origin: apache/cxf
private Enum createCorbaEnum(XmlSchemaSimpleTypeRestriction restrictionType, QName name,
QName schematypeName) {
Enum corbaEnum = new Enum();
corbaEnum.setType(schematypeName);
corbaEnum.setName(name.getLocalPart());
corbaEnum.setQName(name);
corbaEnum.setRepositoryID(REPO_STRING + name.getLocalPart().replace('.', '/') + IDL_VERSION);
for (XmlSchemaFacet f : restrictionType.getFacets()) {
XmlSchemaEnumerationFacet val = (XmlSchemaEnumerationFacet)f;
Enumerator enumerator = new Enumerator();
enumerator.setValue(val.getValue().toString());
corbaEnum.getEnumerator().add(enumerator);
}
return corbaEnum;
}
代码示例来源:origin: apache/cxf
@Override
public void writeSchema(XmlSchema root) {
XmlSchemaSimpleType simple = new XmlSchemaSimpleType(root, true);
simple.setName(getSchemaType().getLocalPart());
XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
restriction.setBaseTypeName(Constants.XSD_STRING);
simple.setContent(restriction);
Object[] cOnstants= getTypeClass().getEnumConstants();
List
for (Object constant : constants) {
XmlSchemaEnumerationFacet f = new XmlSchemaEnumerationFacet();
f.setValue(getValue(constant));
facets.add(f);
}
}
代码示例来源:origin: org.apache.cxf/cxf-rt-databinding-aegis
@Override
public void writeSchema(XmlSchema root) {
XmlSchemaSimpleType simple = new XmlSchemaSimpleType(root, true);
simple.setName(getSchemaType().getLocalPart());
XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
restriction.setBaseTypeName(Constants.XSD_STRING);
simple.setContent(restriction);
Object[] cOnstants= getTypeClass().getEnumConstants();
List
for (Object constant : constants) {
XmlSchemaEnumerationFacet f = new XmlSchemaEnumerationFacet();
f.setValue(getValue(constant));
facets.add(f);
}
}
代码示例来源:origin: raml-org/raml-java-parser
@Nonnull
protected XmlSchemaType createNumberSchemaType(NumberResolvedType numberTypeDefinition, QName baseType)
{
final XmlSchemaSimpleType simpleType = new XmlSchemaSimpleType(schema, false);
final XmlSchemaSimpleTypeRestriction cOntent= new XmlSchemaSimpleTypeRestriction();
content.setBaseTypeName(baseType);
if (numberTypeDefinition.getMinimum() != null)
{
final XmlSchemaMinInclusiveFacet minLength = new XmlSchemaMinInclusiveFacet();
minLength.setValue(numberTypeDefinition.getMinimum());
content.getFacets().add(minLength);
}
if (numberTypeDefinition.getMaximum() != null)
{
final XmlSchemaMaxInclusiveFacet maxLength = new XmlSchemaMaxInclusiveFacet();
maxLength.setValue(numberTypeDefinition.getMaximum());
content.getFacets().add(maxLength);
}
simpleType.setContent(content);
return simpleType;
}
代码示例来源:origin: org.raml/raml-parser-2
@Nonnull
protected XmlSchemaType createNumberSchemaType(NumberResolvedType numberTypeDefinition, QName baseType)
{
final XmlSchemaSimpleType simpleType = new XmlSchemaSimpleType(schema, false);
final XmlSchemaSimpleTypeRestriction cOntent= new XmlSchemaSimpleTypeRestriction();
content.setBaseTypeName(baseType);
if (numberTypeDefinition.getMinimum() != null)
{
final XmlSchemaMinInclusiveFacet minLength = new XmlSchemaMinInclusiveFacet();
minLength.setValue(numberTypeDefinition.getMinimum());
content.getFacets().add(minLength);
}
if (numberTypeDefinition.getMaximum() != null)
{
final XmlSchemaMaxInclusiveFacet maxLength = new XmlSchemaMaxInclusiveFacet();
maxLength.setValue(numberTypeDefinition.getMaximum());
content.getFacets().add(maxLength);
}
simpleType.setContent(content);
return simpleType;
}
代码示例来源:origin: raml-org/raml-java-parser
content.getFacets().add(minLength);
content.getFacets().add(maxLength);
content.getFacets().add(enumValue);
content.getFacets().add(patternFacet);
代码示例来源:origin: org.raml/raml-parser-2
content.getFacets().add(minLength);
content.getFacets().add(maxLength);
content.getFacets().add(enumValue);
content.getFacets().add(patternFacet);
代码示例来源:origin: apache/cxf
XmlSchemaMaxLengthFacet maxLengthFacet = new XmlSchemaMaxLengthFacet();
maxLengthFacet.setValue(boundNode.toString());
restriction.getFacets().add(maxLengthFacet);
simpleType.setContent(restriction);
代码示例来源:origin: apache/cxf
enumSchemaSimpleTypeRestriction.getFacets().add(enumeration);