public CArrayInfo(Model model,CNonElement itemType, XSComponent source, CCustomizations customizations) { super(model,source,customizations); this.itemType = itemType; assert itemType.getTypeName()!=null; this.typeName = ArrayInfoImpl.calcArrayTypeName(itemType.getTypeName()); }
public JType toType(Outline o, Aspect aspect) { return itemType.toType(o,aspect).array(); }
public String fullName() { return itemType.getType().fullName()+"[]"; }
public CPropertyInfo createElementPropertyInfo(String propertyName, XSComponent source, TypeUse propertyType, QName propertyQName, CollectionMode collectionMode, CCustomizations customizations) { final CNonElement propertyTypeInfo = propertyType.getInfo(); final CElementPropertyInfo propertyInfo = new CElementPropertyInfo( propertyName, collectionMode, propertyTypeInfo.idUse(), propertyTypeInfo.getExpectedMimeType(), source, customizations, null, true); final CTypeRef typeRef = new CTypeRef(propertyTypeInfo, propertyQName, propertyTypeInfo.getTypeName(), false, null); propertyInfo.setAdapter(propertyType.getAdapterUse()); propertyInfo.getTypes().add(typeRef); return propertyInfo; }
JType baseExposedType = e.base.toType(this, EXPOSED).unboxify(); JType baseImplType = e.base.toType(this,Aspect.IMPLEMENTATION).unboxify(); constRef.arg(e.base.createConstant(this, new XmlString(mem.getLexicalValue())));
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); } }
JType baseExposedType = e.base.toType(this, EXPOSED).unboxify(); JType baseImplType = e.base.toType(this, Aspect.IMPLEMENTATION).unboxify(); constRef.arg(e.base.createConstant(this, new XmlString(mem.getLexicalValue())));
public CPropertyInfo createElementPropertyInfo(String propertyName, XSComponent source, TypeUse propertyType, QName propertyQName, CollectionMode collectionMode, CCustomizations customizations) { final CNonElement propertyTypeInfo = propertyType.getInfo(); final CElementPropertyInfo propertyInfo = new CElementPropertyInfo( propertyName, collectionMode, propertyTypeInfo.idUse(), propertyTypeInfo.getExpectedMimeType(), source, customizations, null, true); final CTypeRef typeRef = new CTypeRef(propertyTypeInfo, propertyQName, propertyTypeInfo.getTypeName(), false, null); propertyInfo.setAdapter(propertyType.getAdapterUse()); propertyInfo.getTypes().add(typeRef); return propertyInfo; }
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); } }
public CArrayInfo(Model model,CNonElement itemType, XSComponent source, CCustomizations customizations) { super(model,source,customizations); this.itemType = itemType; assert itemType.getTypeName()!=null; this.typeName = ArrayInfoImpl.calcArrayTypeName(itemType.getTypeName()); }
public JType toType(Outline o, Aspect aspect) { return itemType.toType(o,aspect).array(); }
JType baseExposedType = e.base.toType(this, EXPOSED).unboxify(); JType baseImplType = e.base.toType(this,Aspect.IMPLEMENTATION).unboxify(); constRef.arg(e.base.createConstant(this, new XmlString(mem.getLexicalValue())));
public String fullName() { return itemType.getType().fullName()+"[]"; }
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); } }
public CArrayInfo(Model model,CNonElement itemType, XSComponent source, CCustomizations customizations) { super(model,source,customizations); this.itemType = itemType; assert itemType.getTypeName()!=null; this.typeName = ArrayInfoUtil.calcArrayTypeName(itemType.getTypeName()); }
public JType toType(Outline o, Aspect aspect) { return itemType.toType(o,aspect).array(); }
JType baseExposedType = e.base.toType(this, EXPOSED).unboxify(); JType baseImplType = e.base.toType(this, Aspect.IMPLEMENTATION).unboxify(); constRef.arg(e.base.createConstant(this, new XmlString(mem.getLexicalValue())));
public String fullName() { return itemType.getType().fullName()+"[]"; }
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); } }
public CArrayInfo(Model model,CNonElement itemType, XSComponent source, CCustomizations customizations) { super(model,source,customizations); this.itemType = itemType; assert itemType.getTypeName()!=null; this.typeName = ArrayInfoUtil.calcArrayTypeName(itemType.getTypeName()); }