本文整理汇总了Java中org.apache.ws.commons.schema.XmlSchemaEnumerationFacet类的典型用法代码示例。如果您正苦于以下问题:Java XmlSchemaEnumerationFacet类的具体用法?Java XmlSchemaEnumerationFacet怎么用?Java XmlSchemaEnumerationFacet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmlSchemaEnumerationFacet类属于org.apache.ws.commons.schema包,在下文中一共展示了XmlSchemaEnumerationFacet类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createEnumerationFacet
import org.apache.ws.commons.schema.XmlSchemaEnumerationFacet; //导入依赖的package包/类
/**
* Create an XML schema enumeration facet.
*
* @param conditionValue the value to set
* @return an XML schema enumeration facet
*/
protected XmlSchemaEnumerationFacet createEnumerationFacet(
final String conditionValue) {
XmlSchemaEnumerationFacet xmlSchemaEnumerationFacet = new XmlSchemaEnumerationFacet();
xmlSchemaEnumerationFacet.setValue(conditionValue);
return xmlSchemaEnumerationFacet;
}
开发者ID:legsem,项目名称:legstar-cob2xsd,代码行数:13,代码来源:XsdEmitter.java
示例2: enumLiteralFromFacet
import org.apache.ws.commons.schema.XmlSchemaEnumerationFacet; //导入依赖的package包/类
private static final EnumLiteral enumLiteralFromFacet(final XmlSchemaEnumerationFacet enumFacet,
final Xsd2UmlConfig context) {
final List<TaggedValue> annotation = annotations(enumFacet, context);
// We're assuming here that the whiteSpace facet for this enumeration
// type is "collapse".
// In general, this will not be true and we will have to compute it.
final String name = XmlTools.collapseWhitespace(enumFacet.getValue().toString());
return new EnumLiteral(name, annotation);
}
开发者ID:inbloom,项目名称:secure-data-service,代码行数:10,代码来源:Xsd2UmlConvert.java
示例3: decorateText
import org.apache.ws.commons.schema.XmlSchemaEnumerationFacet; //导入依赖的package包/类
public String decorateText(String text, Object element) {
String decoratedText = text;
if (element != null) {
if (element instanceof XmlSchemaObject) {
XmlSchemaObject xso = (XmlSchemaObject) element;
XmlSchemaType type = null;
String value = null;
if (element instanceof XmlSchemaElement) {
type = SchemaMeta.getType(xso, ((XmlSchemaElement) element).getSchemaTypeName());
} else if (element instanceof XmlSchemaAttribute) {
XmlSchemaAttribute attr = (XmlSchemaAttribute) element;
type = SchemaMeta.getType(xso, attr.getSchemaTypeName());
value = attr.getDefaultValue();
value = value == null ? attr.getFixedValue() : "default:" + value;
} else if (element instanceof XmlSchemaSimpleContentExtension) {
type = SchemaMeta.getType(xso, ((XmlSchemaSimpleContentExtension) element).getBaseTypeName());
} else if (element instanceof XmlSchemaSimpleTypeRestriction) {
type = SchemaMeta.getType(xso, ((XmlSchemaSimpleTypeRestriction) element).getBaseTypeName());
} else if (element instanceof XmlSchemaEnumerationFacet) {
XmlSchemaEnumerationFacet enumerationFacet = (XmlSchemaEnumerationFacet) element;
decoratedText += " [" + enumerationFacet.getValue() + "]";
}
if (value != null) {
decoratedText += " {" + value + "}";
}
if (type != null && type instanceof XmlSchemaSimpleType) {
decoratedText += " [" + SchemaMeta.getPrefix(type) + ":" + type.getName() + "]";
}
int size = SchemaMeta.getReferencedDatabaseObjects(xso).size();
if (size > 1 || size >= 0 && element instanceof XmlSchemaComplexType && ((XmlSchemaComplexType) element).getName() != null) {
decoratedText += " (" + size + ")";
}
String prefix = SchemaMeta.getPrefix(xso);
if (prefix != null) {
decoratedText = prefix + ":" + decoratedText;
}
}
}
return decoratedText;
}
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:47,代码来源:SchemaViewLabelDecorator.java
示例4: createXmlTypeInfo
import org.apache.ws.commons.schema.XmlSchemaEnumerationFacet; //导入依赖的package包/类
public static XmlTypeInfo createXmlTypeInfo(QName qname, XmlSchemaType type) {
if (qname == null) throw new NullPointerException("qname is null");
if (type == null) throw new NullPointerException("type is null");
XmlTypeInfo typeInfo = new XmlTypeInfo();
typeInfo.qname = qname;
typeInfo.anonymous = qname.getLocalPart().indexOf('>') >= 0;
if (type instanceof XmlSchemaSimpleType) {
XmlSchemaSimpleType simpleType = (XmlSchemaSimpleType) type;
XmlSchemaSimpleTypeContent content = simpleType.getContent();
if (content instanceof XmlSchemaSimpleTypeList) {
XmlSchemaSimpleTypeList list = (XmlSchemaSimpleTypeList) content;
typeInfo.simpleBaseType = list.getItemType().getQName();
// this is a list
typeInfo.listType = true;
} else if (content instanceof XmlSchemaSimpleTypeRestriction) {
XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
typeInfo.simpleBaseType = restriction.getBaseTypeName();
// is this an enumeration?
for (Iterator iterator = restriction.getFacets().getIterator(); iterator.hasNext(); ) {
if (iterator.next() instanceof XmlSchemaEnumerationFacet) {
typeInfo.enumType = true;
break;
}
}
}
} else if (type instanceof XmlSchemaComplexType) {
XmlSchemaComplexType complexType = (XmlSchemaComplexType) type;
// SOAP array component type
typeInfo.arrayComponentType = extractSoapArrayComponentType(complexType);
// process attributes (skip soap arrays which have non-mappable attributes)
if (!isSoapArray(complexType)) {
XmlSchemaObjectCollection attributes = complexType.getAttributes();
for (Iterator iterator = attributes.getIterator(); iterator.hasNext(); ) {
Object item = iterator.next();
if (item instanceof XmlSchemaAttribute) {
XmlSchemaAttribute attribute = (XmlSchemaAttribute) item;
Object old = typeInfo.attributes.put(attribute.getQName().getLocalPart(), attribute.getSchemaTypeName());
if (old != null) {
throw new IllegalArgumentException("Complain to your expert group member, spec does not support attributes with the same local name and differing namespaces: original: " + old + ", duplicate local name: " + attribute);
}
}
}
}
} else {
log.warn("Unknown schema type class " + typeInfo.getClass().getName());
}
return typeInfo;
}
开发者ID:apache,项目名称:tomee,代码行数:57,代码来源:CommonsSchemaInfoBuilder.java
注:本文中的org.apache.ws.commons.schema.XmlSchemaEnumerationFacet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论