本文整理汇总了Java中com.sun.xml.internal.xsom.XSSimpleType类的典型用法代码示例。如果您正苦于以下问题:Java XSSimpleType类的具体用法?Java XSSimpleType怎么用?Java XSSimpleType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XSSimpleType类属于com.sun.xml.internal.xsom包,在下文中一共展示了XSSimpleType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: canBeMappedToTypeSafeEnum
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
/**
* Returns true if the given simple type can be mapped to a
* type-safe enum class.
*
* <p>
* JAXB spec places a restrictrion as to what type can be
* mapped to a type-safe enum. This method enforces this
* constraint.
*/
public static boolean canBeMappedToTypeSafeEnum( XSSimpleType type ) {
do {
if( WellKnownNamespace.XML_SCHEMA.equals(type.getTargetNamespace()) ) {
// type must be derived from one of these types
String localName = type.getName();
if( localName!=null ) {
if( localName.equals("anySimpleType") )
return false; // catch all case
if( localName.equals("ID") || localName.equals("IDREF") )
return false; // not ID/IDREF
// other allowed list
if( builtinTypeSafeEnumCapableTypes.contains(localName) )
return true;
}
}
type = type.getSimpleBaseType();
} while( type!=null );
return false;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:32,代码来源:SimpleTypeBuilder.java
示例2: iterator
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
public Iterator<XSSimpleType> iterator() {
return new Iterator<XSSimpleType>() {
int idx=0;
public boolean hasNext() {
return idx<memberTypes.length;
}
public XSSimpleType next() {
return memberTypes[idx++].getType();
}
public void remove() {
throw new UnsupportedOperationException();
}
};
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:UnionSimpleTypeImpl.java
示例3: errorCheck
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
/**
* Performs error check
*/
public void errorCheck() {
ErrorReceiver er = Ring.get(ErrorReceiver.class);
for (QName n : enumBaseTypes) {
XSSchemaSet xs = Ring.get(XSSchemaSet.class);
XSSimpleType st = xs.getSimpleType(n.getNamespaceURI(), n.getLocalPart());
if(st==null) {
er.error(loc,Messages.ERR_UNDEFINED_SIMPLE_TYPE.format(n));
continue;
}
if(!SimpleTypeBuilder.canBeMappedToTypeSafeEnum(st)) {
er.error(loc,Messages.ERR_CANNOT_BE_BOUND_TO_SIMPLETYPE.format(n));
continue;
}
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:BIGlobalBinding.java
示例4: getTypeUse
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
public TypeUse getTypeUse(XSSimpleType owner) {
if(typeUse!=null)
return typeUse;
JCodeModel cm = getCodeModel();
JDefinedClass a;
try {
a = cm._class(adapter);
a.hide(); // we assume this is given by the user
a._extends(cm.ref(XmlAdapter.class).narrow(String.class).narrow(
cm.ref(type)));
} catch (JClassAlreadyExistsException e) {
a = e.getExistingClass();
}
// TODO: it's not correct to say that it adapts from String,
// but OTOH I don't think we can compute that.
typeUse = TypeUseFactory.adapt(
CBuiltinLeafInfo.STRING,
new CAdapter(a));
return typeUse;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:BIConversion.java
示例5: dump
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
/**
* Creates node for attribute declaration with additional attributes.
*
* @param decl Attribute declaration.
* @param additionalAtts Additional attributes.
*/
private void dump(XSAttributeDecl decl, String additionalAtts) {
XSSimpleType type = decl.getType();
String str = MessageFormat.format("Attribute \"{0}\"{1}{2}{3}{4}",
new Object[]{
decl.getName(),
additionalAtts,
type.isLocal() ? "" : MessageFormat.format(
" type=\"'{'{0}'}'{1}\"", new Object[]{
type.getTargetNamespace(),
type.getName()}),
decl.getFixedValue() == null ? "" : " fixed=\""
+ decl.getFixedValue() + "\"",
decl.getDefaultValue() == null ? "" : " default=\""
+ decl.getDefaultValue() + "\""});
SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator());
this.currNode.add(newNode);
this.currNode = newNode;
if (type.isLocal()) {
simpleType(type);
}
this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:SchemaTreeTraverser.java
示例6: dump
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
private void dump( XSAttributeDecl decl, String additionalAtts ) {
XSSimpleType type=decl.getType();
println(MessageFormat.format("<attribute name=\"{0}\"{1}{2}{3}{4}{5}>",
decl.getName(),
additionalAtts,
type.isLocal()?"":
MessageFormat.format(" type=\"'{'{0}'}'{1}\"", type.getTargetNamespace(), type.getName()),
decl.getFixedValue()==null ?
"":" fixed=\""+decl.getFixedValue()+'\"',
decl.getDefaultValue()==null ?
"":" default=\""+decl.getDefaultValue()+'\"',
type.isLocal()?"":" /"));
if(type.isLocal()) {
indent++;
simpleType(type);
indent--;
println("</attribute>");
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:SchemaWriter.java
示例7: dispatchGlobalConversions
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
/**
* Moves global BIConversion to the right object.
*/
public void dispatchGlobalConversions( XSSchemaSet schema ) {
// also set parent to the global conversions
for( Map.Entry<QName,BIConversion> e : globalConversions.entrySet() ) {
QName name = e.getKey();
BIConversion conv = e.getValue();
XSSimpleType st = schema.getSimpleType(name.getNamespaceURI(),name.getLocalPart());
if(st==null) {
Ring.get(ErrorReceiver.class).error(
getLocation(),
Messages.ERR_UNDEFINED_SIMPLE_TYPE.format(name)
);
continue; // abort
}
getBuilder().getOrCreateBindInfo(st).addDecl(conv);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:BIGlobalBinding.java
示例8: iterateSimpleTypes
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
public Iterator<XSSimpleType> iterateSimpleTypes() {
return new Iterators.Map<XSSimpleType,XSSchema>(iterateSchema()) {
protected Iterator<XSSimpleType> apply(XSSchema u) {
return u.iterateSimpleTypes();
}
};
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:SchemaSetImpl.java
示例9: ignorableDuplicateComponent
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
public static boolean ignorableDuplicateComponent(XSDeclaration c) {
if(c.getTargetNamespace().equals(Const.schemaNamespace)) {
if(c instanceof XSSimpleType)
// hide artificial "double definitions" on simple types
return true;
if(c.isGlobal() && c.getName().equals("anyType"))
return true; // ditto for anyType
}
return false;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:NGCCRuntimeEx.java
示例10: restrictionSimpleType
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
public void restrictionSimpleType(XSRestrictionSimpleType type) {
if (type.getBaseType() == null) {
// don't print anySimpleType
if (!type.getName().equals("anySimpleType")) {
throw new InternalError();
}
if (!Const.schemaNamespace.equals(type.getTargetNamespace())) {
throw new InternalError();
}
return;
}
XSSimpleType baseType = type.getSimpleBaseType();
String str = MessageFormat.format("Restriction {0}",
new Object[]{baseType.isLocal() ? "" : " base=\"{"
+ baseType.getTargetNamespace() + "}"
+ baseType.getName() + "\""});
SchemaTreeNode newNode = new SchemaTreeNode(str, baseType.getLocator());
this.currNode.add(newNode);
this.currNode = newNode;
if (baseType.isLocal()) {
simpleType(baseType);
}
Iterator itr = type.iterateDeclaredFacets();
while (itr.hasNext()) {
facet((XSFacet) itr.next());
}
this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:36,代码来源:SchemaTreeTraverser.java
示例11: schema
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
public void schema(XSSchema s) {
// QUICK HACK: don't print the built-in components
if (s.getTargetNamespace().equals(Const.schemaNamespace)) {
return;
}
SchemaTreeNode newNode = new SchemaTreeNode("Schema "
+ s.getLocator().getSystemId(), s.getLocator());
this.currNode = newNode;
this.model.addSchemaNode(newNode);
for (XSAttGroupDecl groupDecl : s.getAttGroupDecls().values()) {
attGroupDecl(groupDecl);
}
for (XSAttributeDecl attrDecl : s.getAttributeDecls().values()) {
attributeDecl(attrDecl);
}
for (XSComplexType complexType : s.getComplexTypes().values()) {
complexType(complexType);
}
for (XSElementDecl elementDecl : s.getElementDecls().values()) {
elementDecl(elementDecl);
}
for (XSModelGroupDecl modelGroupDecl : s.getModelGroupDecls().values()) {
modelGroupDecl(modelGroupDecl);
}
for (XSSimpleType simpleType : s.getSimpleTypes().values()) {
simpleType(simpleType);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:SchemaTreeTraverser.java
示例12: simpleType
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
public void simpleType( XSSimpleType type ) {
println(MessageFormat.format("<simpleType{0}>", type.isLocal()?"":" name=\""+type.getName()+'\"'));
indent++;
type.visit((XSSimpleTypeVisitor)this);
indent--;
println("</simpleType>");
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:SchemaWriter.java
示例13: listSimpleType
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
public void listSimpleType( XSListSimpleType type ) {
XSSimpleType itemType = type.getItemType();
if(itemType.isLocal()) {
println("<list>");
indent++;
simpleType(itemType);
indent--;
println("</list>");
} else {
// global type
println(MessageFormat.format("<list itemType=\"'{'{0}'}'{1}\" />",
itemType.getTargetNamespace(), itemType.getName()));
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:SchemaWriter.java
示例14: simpleType
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
public Iterator<XSFacet> simpleType(XSSimpleType type) {
// TODO: it's not clear if "facets" mean all inherited facets or just declared facets
XSRestrictionSimpleType r = type.asRestriction();
if(r!=null)
return r.iterateDeclaredFacets();
else
return empty();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:Axis.java
示例15: buildDef
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
/**
* A version of the {@link #build(XSSimpleType)} method
* used to bind the definition of a class generated from
* the given simple type.
*/
public TypeUse buildDef( XSSimpleType type ) {
XSSimpleType oldi = initiatingType;
this.initiatingType = type;
TypeUse e = type.apply(composer);
initiatingType = oldi;
return e;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:SimpleTypeBuilder.java
示例16: build
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
/**
* Entry point from outside. Builds a BGM type expression
* from a simple type schema component.
*
* @param type
* the simple type to be bound.
*/
public TypeUse build( XSSimpleType type ) {
XSSimpleType oldi = initiatingType;
this.initiatingType = type;
TypeUse e = checkRefererCustomization(type);
if(e==null)
e = compose(type);
initiatingType = oldi;
return e;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:SimpleTypeBuilder.java
示例17: parseMethodFor
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
private String parseMethodFor(XSSimpleType owner) {
if(parseMethod!=null) return parseMethod;
if(inMemoryType.unboxify().isPrimitive()) {
String method = getConversionMethod("parse", owner);
if(method!=null) {
// this cast is necessary for conversion between primitive Java types
return '('+inMemoryType.unboxify().fullName()+')'+method;
}
}
return "new";
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:BIConversion.java
示例18: findBaseConversion
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
private String findBaseConversion(XSSimpleType owner) {
// find the base simple type mapping.
for( XSSimpleType st=owner; st!=null; st = st.getSimpleBaseType() ) {
if( !WellKnownNamespace.XML_SCHEMA.equals(st.getTargetNamespace()) )
continue; // user-defined type
String name = st.getName().intern();
for( String s : knownBases )
if(name.equalsIgnoreCase(s))
return s;
}
return null;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:BIConversion.java
示例19: listSimpleType
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
public TypeUse listSimpleType(XSListSimpleType type) {
// bind item type individually and then compose them into a list
// facets on the list shouldn't be taken account when binding item types,
// so weed to call build(), not compose().
XSSimpleType itemType = type.getItemType();
refererStack.push(itemType);
TypeUse tu = TypeUseFactory.makeCollection(build(type.getItemType()));
refererStack.pop();
return tu;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:SimpleTypeBuilder.java
示例20: simpleType
import com.sun.xml.internal.xsom.XSSimpleType; //导入依赖的package包/类
public CElement simpleType(XSSimpleType type) {
CElement c = allow(type,type.getName());
if(c!=null) return c;
if(getGlobalBinding().isSimpleTypeSubstitution() && type.isGlobal()) {
return new CClassInfo(model,selector.getClassScope(),
deriveName(type), type.getLocator(), getName(type), null, type, null );
}
return never();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:DefaultClassBinder.java
注:本文中的com.sun.xml.internal.xsom.XSSimpleType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论