public SingleEnumValueWrappingField(ClassOutlineImpl context, CPropertyInfo prop, CPropertyInfo core) { super(context, prop, core); // Single assert !core.isCollection(); // Builtin assert core.ref().size() == 1; assert core.ref().iterator().next() instanceof CEnumLeafInfo; this.enumType = (CEnumLeafInfo) core.ref().iterator().next(); this.enumClass = this.enumType.toType(context.parent(), Aspect.EXPOSED); }
/** Creates an element-local enumeration declaration. */ static BIEnumeration create( Element dom, BIElement parent ) { // create a class as a nested class return new BIEnumeration( dom, new CEnumLeafInfo( parent.parent.model, null, parent.clazz, DOMUtil.getAttribute(dom,"name"), CBuiltinLeafInfo.STRING, buildMemberList(parent.parent.model,dom), null, null/*TODO*/, DOMLocator.getLocationInfo(dom) )); }
/*package*/ void add( CEnumLeafInfo e ) { enums.put( e.getClazz(), e ); }
writeTypeName(e.getTypeName(), xtw, eo._package().getMostUsedNamespaceURI()); boolean needsValue = e.needsValueField(); getErrorReceiver().error( e.getLocator(), Messages.ERR_UNUSABLE_NAME.format(mem.getLexicalValue(), constName ) ); getErrorReceiver().error( e.getLocator(), Messages.ERR_NAME_COLLISION.format(constName));
public EpisodeBuilder addEnum(final EnumOutline enumOutline) { this.outlines.add(new OutlineAdaptor(enumOutline.target.getSchemaComponent(), OutlineAdaptor.OutlineType.ENUM, enumOutline.clazz)); return this; }
/** * Generates the minimum {@link JDefinedClass} skeleton * without filling in its body. */ private EnumOutline generateEnumDef(CEnumLeafInfo e) { JDefinedClass type; type = getClassFactory().createClass( getContainer(e.parent, EXPOSED),e.shortName,e.getLocator(), ClassType.ENUM); type.javadoc().append(e.javadoc); return new EnumOutline(e, type) { @Override public @NotNull Outline parent() { return BeanGenerator.this; } }; }
writeTypeName(e.getTypeName(), xtw, eo._package().getMostUsedNamespaceURI()); boolean needsValue = e.needsValueField(); getErrorReceiver().error( e.getLocator(), Messages.ERR_UNUSABLE_NAME.format(mem.getLexicalValue(), constName ) ); getErrorReceiver().error( e.getLocator(), Messages.ERR_NAME_COLLISION.format(constName));
@Override public XSComponent getSchemaComponent() { return getSource().getSchemaComponent(); } }
/** * Generates the minimum {@link JDefinedClass} skeleton * without filling in its body. */ private EnumOutline generateEnumDef(CEnumLeafInfo e) { JDefinedClass type; type = getClassFactory().createClass( getContainer(e.parent, EXPOSED),e.shortName,e.getLocator(), ClassType.ENUM); type.javadoc().append(e.javadoc); return new EnumOutline(e, type) { @Override public @NotNull Outline parent() { return BeanGenerator.this; } }; }
writeTypeName(e.getTypeName(), xtw, eo._package().getMostUsedNamespaceURI()); boolean needsValue = e.needsValueField(); getErrorReceiver().error(e.getLocator(), Messages.ERR_UNUSABLE_NAME.format(mem.getLexicalValue(), constName)); getErrorReceiver().error(e.getLocator(), Messages.ERR_NAME_COLLISION.format(constName));
/** Creates an element-local enumeration declaration. */ static BIEnumeration create( Element dom, BIElement parent ) { // create a class as a nested class return new BIEnumeration( dom, new CEnumLeafInfo( parent.parent.model, null, parent.clazz, DOMUtil.getAttribute(dom,"name"), CBuiltinLeafInfo.STRING, buildMemberList(parent.parent.model,dom), null, null/*TODO*/, DOMLocator.getLocationInfo(dom) )); }
public SingleEnumValueWrappingField(ClassOutlineImpl context, CPropertyInfo prop, CPropertyInfo core) { super(context, prop, core); // Single assert !core.isCollection(); // Builtin assert core.ref().size() == 1; assert core.ref().iterator().next() instanceof CEnumLeafInfo; this.enumType = (CEnumLeafInfo) core.ref().iterator().next(); this.enumClass = this.enumType.toType(context.parent(), Aspect.EXPOSED); }
XSComponent sc = eo.target.getSchemaComponent(); String fullName = eo.clazz.fullName(); String packageName = eo.clazz.getPackage().name();
/*package*/ void add( CEnumLeafInfo e ) { enums.put( e.getClazz(), e ); }
/** * Generates the minimum {@link JDefinedClass} skeleton * without filling in its body. */ private EnumOutline generateEnumDef(CEnumLeafInfo e) { JDefinedClass type; type = getClassFactory().createClass( getContainer(e.parent, EXPOSED), e.shortName, e.getLocator(), ClassType.ENUM); type.javadoc().append(e.javadoc); return new EnumOutline(e, type) { @Override public @NotNull Outline parent() { return BeanGenerator.this; } }; }
writeTypeName(e.getTypeName(), xtw, eo._package().getMostUsedNamespaceURI()); boolean needsValue = e.needsValueField(); getErrorReceiver().error(e.getLocator(), Messages.ERR_UNUSABLE_NAME.format(mem.getLexicalValue(), constName)); getErrorReceiver().error(e.getLocator(), Messages.ERR_NAME_COLLISION.format(constName));
/** Creates an element-local enumeration declaration. */ static BIEnumeration create( Element dom, BIElement parent ) { // create a class as a nested class return new BIEnumeration( dom, new CEnumLeafInfo( parent.parent.model, null, parent.clazz, DOMUtil.getAttribute(dom,"name"), CBuiltinLeafInfo.STRING, buildMemberList(parent.parent.model,dom), null, null/*TODO*/, DOMLocator.getLocationInfo(dom) )); }
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; }
XSComponent sc = eo.target.getSchemaComponent(); String fullName = eo.clazz.fullName(); String packageName = eo.clazz.getPackage().name();
/*package*/ void add( CEnumLeafInfo e ) { enums.put( e.getClazz(), e ); }