本文整理汇总了Java中com.sun.xml.internal.xsom.XmlString类的典型用法代码示例。如果您正苦于以下问题:Java XmlString类的具体用法?Java XmlString怎么用?Java XmlString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmlString类属于com.sun.xml.internal.xsom包,在下文中一共展示了XmlString类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initContentType
import com.sun.xml.internal.xsom.XmlString; //导入依赖的package包/类
public void initContentType(TypeUse contentType, @Nullable XSElementDecl source, XmlString defaultValue) {
assert this.property==null; // must not be called twice
this.property = new CElementPropertyInfo("Value",
contentType.isCollection()?REPEATED_VALUE:NOT_REPEATED,
contentType.idUse(),
contentType.getExpectedMimeType(),
source,null,getLocator(),true);
this.property.setAdapter(contentType.getAdapterUse());
BIInlineBinaryData.handle(source,property);
property.getTypes().add(new CTypeRef(contentType.getInfo(),tagName,CTypeRef.getSimpleTypeName(source), true,defaultValue));
this.type = NavigatorImpl.createParameterizedType(
NavigatorImpl.theInstance.ref(JAXBElement.class),
getContentInMemoryType() );
BIFactoryMethod factoryMethod = Ring.get(BGMBuilder.class).getBindInfo(source).get(BIFactoryMethod.class);
if(factoryMethod!=null) {
factoryMethod.markAsAcknowledged();
this.squeezedName = factoryMethod.name;
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:CElementInfo.java
示例2: createConstant
import com.sun.xml.internal.xsom.XmlString; //导入依赖的package包/类
public JExpression createConstant(Outline outline, XmlString lexical) {
if(isCollection()) return null;
if(adapter==null) return coreType.createConstant(outline, lexical);
// [RESULT] new Adapter().unmarshal(CONSTANT);
JExpression cons = coreType.createConstant(outline, lexical);
Class<? extends XmlAdapter> atype = adapter.getAdapterIfKnown();
// try to run the adapter now rather than later.
if(cons instanceof JStringLiteral && atype!=null) {
JStringLiteral scons = (JStringLiteral) cons;
XmlAdapter a = ClassFactory.create(atype);
try {
Object value = a.unmarshal(scons.str);
if(value instanceof String) {
return JExpr.lit((String)value);
}
} catch (Exception e) {
// assume that we can't eagerly bind this
}
}
return JExpr._new(adapter.getAdapterClass(outline)).invoke("unmarshal").arg(cons);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:TypeUseImpl.java
示例3: AttributeDeclImpl
import com.sun.xml.internal.xsom.XmlString; //导入依赖的package包/类
public AttributeDeclImpl( SchemaDocumentImpl owner,
String _targetNamespace, String _name,
AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa, boolean _anonymous,
XmlString _defValue, XmlString _fixedValue,
Ref.SimpleType _type ) {
super(owner,_annon,_loc,_fa,_targetNamespace,_name,_anonymous);
if(_name==null) // assertion failed.
throw new IllegalArgumentException();
this.defaultValue = _defValue;
this.fixedValue = _fixedValue;
this.type = _type;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:AttributeDeclImpl.java
示例4: AttributeUseImpl
import com.sun.xml.internal.xsom.XmlString; //导入依赖的package包/类
public AttributeUseImpl( SchemaDocumentImpl owner, AnnotationImpl ann, Locator loc, ForeignAttributesImpl fa, Ref.Attribute _decl,
XmlString def, XmlString fixed, boolean req ) {
super(owner,ann,loc,fa);
this.att = _decl;
this.defaultValue = def;
this.fixedValue = fixed;
this.required = req;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:AttributeUseImpl.java
示例5: FacetImpl
import com.sun.xml.internal.xsom.XmlString; //导入依赖的package包/类
public FacetImpl( SchemaDocumentImpl owner, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa,
String _name, XmlString _value, boolean _fixed ) {
super(owner,_annon,_loc,_fa);
this.name = _name;
this.value = _value;
this.fixed = _fixed;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:FacetImpl.java
示例6: ElementDecl
import com.sun.xml.internal.xsom.XmlString; //导入依赖的package包/类
public ElementDecl( PatcherManager reader, SchemaDocumentImpl owner,
AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl fa,
String _tns, String _name, boolean _anonymous,
XmlString _defv, XmlString _fixedv,
boolean _nillable, boolean _abstract, Boolean _form,
Ref.Type _type, Ref.Element _substHead,
int _substDisallowed, int _substExcluded,
List<IdentityConstraintImpl> idConstraints) {
super(owner,_annon,_loc,fa,_tns,_name,_anonymous);
this.defaultValue = _defv;
this.fixedValue = _fixedv;
this.nillable = _nillable;
this._abstract = _abstract;
this.form = _form;
this.type = _type;
this.substHead = _substHead;
this.substDisallowed = _substDisallowed;
this.substExcluded = _substExcluded;
this.idConstraints = Collections.unmodifiableList((List<? extends XSIdentityConstraint>)idConstraints);
for (IdentityConstraintImpl idc : idConstraints)
idc.setParent(this);
if(type==null)
throw new IllegalArgumentException();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:ElementDecl.java
示例7: createAttribute
import com.sun.xml.internal.xsom.XmlString; //导入依赖的package包/类
protected CPropertyInfo createAttribute(
String elementName, String attributeName, String attributeType,
String[] enums, short attributeUse, String defaultValue )
throws SAXException {
boolean required = attributeUse==USE_REQUIRED;
// get the attribute-property declaration
BIElement edecl = bindInfo.element(elementName);
BIAttribute decl=null;
if(edecl!=null) decl=edecl.attribute(attributeName);
String propName;
if(decl==null) propName = model.getNameConverter().toPropertyName(attributeName);
else propName = decl.getPropertyName();
QName qname = new QName("",attributeName);
// if no declaration is specified, just wrap it by
// a FieldItem and let the normalizer handle its content.
TypeUse use;
if(decl!=null && decl.getConversion()!=null)
use = decl.getConversion().getTransducer();
else
use = builtinConversions.get(attributeType);
CPropertyInfo r = new CAttributePropertyInfo(
propName, null,null/*TODO*/, copyLocator(), qname, use, null, required );
if(defaultValue!=null)
r.defaultValue = CDefaultValue.create( use, new XmlString(defaultValue) );
return r;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:TDTDReader.java
示例8: CElementInfo
import com.sun.xml.internal.xsom.XmlString; //导入依赖的package包/类
/**
* Creates an element in the given parent.
*
* <p>
* When using this construction, {@link #initContentType(TypeUse, XSElementDecl, XmlString)}
* must not be invoked.
*/
public CElementInfo(Model model,QName tagName, CClassInfoParent parent, TypeUse contentType, XmlString defaultValue, XSElementDecl source, CCustomizations customizations, Locator location ) {
super(model,source,location,customizations);
this.tagName = tagName;
this.model = model;
this.parent = parent;
if(contentType!=null)
initContentType(contentType, source, defaultValue);
model.add(this);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:CElementInfo.java
示例9: createConstant
import com.sun.xml.internal.xsom.XmlString; //导入依赖的package包/类
public JExpression createConstant(Outline outline, XmlString lexical) {
QName qn = DatatypeConverter.parseQName(lexical.value,new NamespaceContextAdapter(lexical));
return JExpr._new(outline.getCodeModel().ref(QName.class))
.arg(qn.getNamespaceURI())
.arg(qn.getLocalPart())
.arg(qn.getPrefix());
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:CBuiltinLeafInfo.java
示例10: create
import com.sun.xml.internal.xsom.XmlString; //导入依赖的package包/类
/**
* Creates a new {@link CDefaultValue} that computes the default value
* by applying a lexical representation to a {@link TypeUse}.
*/
public static CDefaultValue create(final TypeUse typeUse, final XmlString defaultValue) {
return new CDefaultValue() {
public JExpression compute(Outline outline) {
return typeUse.createConstant(outline,defaultValue);
}
};
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:CDefaultValue.java
示例11: CTypeRef
import com.sun.xml.internal.xsom.XmlString; //导入依赖的package包/类
public CTypeRef(CNonElement type, QName elementName, QName typeName, boolean nillable, XmlString defaultValue) {
assert type!=null;
assert elementName!=null;
this.type = type;
this.elementName = elementName;
this.typeName = typeName;
this.nillable = nillable;
this.defaultValue = defaultValue;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:CTypeRef.java
示例12: createConstant
import com.sun.xml.internal.xsom.XmlString; //导入依赖的package包/类
public JExpression createConstant(Outline outline, XmlString literal) {
// correctly identifying which constant it maps to is hard, so
// here I'm cheating
JClass type = toType(outline,Aspect.EXPOSED);
for (CEnumConstant mem : members) {
if(mem.getLexicalValue().equals(literal.value))
return type.staticRef(mem.getName());
}
return null;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:CEnumLeafInfo.java
示例13: ElementDecl
import com.sun.xml.internal.xsom.XmlString; //导入依赖的package包/类
public ElementDecl( PatcherManager reader, SchemaDocumentImpl owner,
AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl fa,
String _tns, String _name, boolean _anonymous,
XmlString _defv, XmlString _fixedv,
boolean _nillable, boolean _abstract, Boolean _form,
Ref.Type _type, Ref.Element _substHead,
int _substDisallowed, int _substExcluded,
List<IdentityConstraintImpl> idConstraints) {
super(owner,_annon,_loc,fa,_tns,_name,_anonymous);
this.defaultValue = _defv;
this.fixedValue = _fixedv;
this.nillable = _nillable;
this._abstract = _abstract;
this.form = _form;
this.type = _type;
this.substHead = _substHead;
this.substDisallowed = _substDisallowed;
this.substExcluded = _substExcluded;
this.idConstraints = (List<XSIdentityConstraint>) Collections.unmodifiableList((List<? extends XSIdentityConstraint>)idConstraints);
for (IdentityConstraintImpl idc : idConstraints)
idc.setParent(this);
if(type==null)
throw new IllegalArgumentException();
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:ElementDecl.java
注:本文中的com.sun.xml.internal.xsom.XmlString类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论