private void createClassMap(Map<Class, JClass> classMap, Outline outline, Class... classes) { for (Class clazz : classes) { classMap.put(clazz, (JClass) outline.getModel().codeModel._ref(clazz)); } }
private void addComplexType(Outline outline, Map<String, JFieldVar> namespaceFields) { Set<Map.Entry<NClass, CClassInfo>> set = outline.getModel().beans().entrySet(); for (Map.Entry<NClass, CClassInfo> entry : set) { ClassOutline classOutline = outline.getClazz(entry.getValue()); QName qname = entry.getValue().getTypeName(); if (qname == null) { continue; } JFieldVar namespaceField = namespaceFields.get(qname.getNamespaceURI()); createQName(outline, classOutline.implClass, COMPLEX_TYPE_FIELD_NAME, qname, namespaceField, false, false); } }
private void writeCode(Outline outline) throws IOException { Model model = outline.getModel(); JCodeModel codeModel = model.codeModel; codeModel.build(model.options.createCodeWriter()); }
/** * Gets the {@link Options} in the current compilation context. */ protected final Options getOptions() { return parent().parent().getModel().options; }
/** * Gets the {@link Options} in the current compilation context. */ protected final Options getOptions() { return parent().parent().getModel().options; }
/** * Gets the {@link Options} in the current compilation context. */ protected final Options getOptions() { return parent().parent().getModel().options; }
/** * Gets the {@link Options} in the current compilation context. */ protected final Options getOptions() { return parent().parent().getModel().options; }
private void checkCustomizations(Outline outline) { for (final CClassInfo classInfo : outline.getModel().beans().values()) { checkCustomizations(classInfo); for (final CPropertyInfo propertyInfo : classInfo.getProperties()) { checkCustomizations(classInfo, propertyInfo); } } }
JAXBModelImpl(Outline outline) { this.model = outline.getModel(); this.outline = outline; for (CClassInfo ci : model.beans().values()) { if(!ci.isElement()) continue; byXmlName.put(ci.getElementName(),new BeanMappingImpl(this,ci)); } for (CElementInfo ei : model.getElementMappings(null).values()) { byXmlName.put(ei.getElementName(),new ElementMappingImpl(this,ei)); } }
JAXBModelImpl(Outline outline) { this.model = outline.getModel(); this.outline = outline; for (CClassInfo ci : model.beans().values()) { if(!ci.isElement()) continue; byXmlName.put(ci.getElementName(),new BeanMappingImpl(this,ci)); } for (CElementInfo ei : model.getElementMappings(null).values()) { byXmlName.put(ei.getElementName(),new ElementMappingImpl(this,ei)); } }
private void checkCustomizations(Outline outline) { for (final CClassInfo classInfo : outline.getModel().beans().values()) { checkCustomizations(classInfo); for (final CPropertyInfo propertyInfo : classInfo.getProperties()) { checkCustomizations(classInfo, propertyInfo); } } }
JAXBModelImpl(Outline outline) { this.model = outline.getModel(); this.outline = outline; for (CClassInfo ci : model.beans().values()) { if(!ci.isElement()) continue; byXmlName.put(ci.getElementName(),new BeanMappingImpl(this,ci)); } for (CElementInfo ei : model.getElementMappings(null).values()) { byXmlName.put(ei.getElementName(),new ElementMappingImpl(this,ei)); } }
JAXBModelImpl(Outline outline) { this.model = outline.getModel(); this.outline = outline; for (CClassInfo ci : model.beans().values()) { if(!ci.isElement()) continue; byXmlName.put(ci.getElementName(),new BeanMappingImpl(this,ci)); } for (CElementInfo ei : model.getElementMappings(null).values()) { byXmlName.put(ei.getElementName(),new ElementMappingImpl(this,ei)); } }
public boolean isPackageOutlineIgnored(Mapping context, Outline outline, PackageOutline packageOutline) { for (IgnoredPackage ignoredPackage : getCustomizing() .<IgnoredPackage> findCustomizations(outline.getModel(), Customizations.IGNORED_PACKAGE_ELEMENT_NAME)) { if (packageOutline._package().name() .equals(ignoredPackage.getName())) { return true; } } return false; }
public boolean isPackageOutlineIgnored(Mapping context, Outline outline, PackageOutline packageOutline) { for (IgnoredPackage ignoredPackage : getCustomizing() .<IgnoredPackage> findCustomizations(outline.getModel(), Customizations.IGNORED_PACKAGE_ELEMENT_NAME)) { if (packageOutline._package().name() .equals(ignoredPackage.getName())) { return true; } } return false; }
@Override public String elementDecl(final XSElementDecl decl) { final String customName = getCustomPropertyName(decl); return customName == null ? GroupInterfaceGenerator.this.pluginContext.outline.getModel().getNameConverter().toPropertyName(decl.getName()) : customName; }
@Override public String attributeUse(final XSAttributeUse use) { String customName = getCustomPropertyName(use); customName = customName == null ? getCustomPropertyName(use.getDecl()) : customName; return customName == null ? GroupInterfaceGenerator.this.pluginContext.outline.getModel().getNameConverter().toPropertyName(use.getDecl().getName()) : customName; }
private String getConstantName(final FieldOutline fieldOutline) { final XSComponent schemaComponent = fieldOutline.getPropertyInfo().getSchemaComponent(); if (!this.fixedAttributeAsConstantProperty) return null; if (schemaComponent instanceof XSAttributeDecl) { return ((XSAttributeDecl)schemaComponent).getFixedValue() != null ? fieldOutline.parent().parent().getModel().getNameConverter().toConstantName(((XSAttributeDecl)schemaComponent).getName()) : null; } else { return schemaComponent instanceof XSAttributeUse && ((XSAttributeUse)schemaComponent).getFixedValue() != null ? fieldOutline.parent().parent().getModel().getNameConverter().toConstantName(((XSAttributeUse)schemaComponent).getDecl().getName()) : null; } }
private void generateNameOnlyMetaField(final PluginContext pluginContext, final JDefinedClass metaClass, final FieldOutline fieldOutline) { final PropertyOutline propertyOutline = new DefinedPropertyOutline(fieldOutline); final String constantName = getConstantName(fieldOutline); final Outline outline = pluginContext.outline; final String propertyName = constantName != null ? constantName : propertyOutline.getFieldName(); final String metaFieldName = this.camelCase ? propertyName : fieldOutline.parent().parent().getModel().getNameConverter().toConstantName(propertyName); metaClass.field(JMod.PUBLIC | JMod.STATIC | JMod.FINAL | JMod.TRANSIENT, String.class, metaFieldName, JExpr.lit(propertyName)); }
public static String getGetterMethodName(ClassOutline classOutline, JFieldVar field) { CPropertyInfo prop = classOutline.target.getProperty(field.name()); JType type = field.type(); Options options = classOutline.parent().getModel().options; JCodeModel codeModel = classOutline.parent().getCodeModel(); if (options.enableIntrospection) { return ((type.isPrimitive() && type.boxify().getPrimitiveType() == codeModel.BOOLEAN) ? "is" : "get") + prop.getName(true); } else { return (type.boxify().getPrimitiveType() == codeModel.BOOLEAN ? "is" : "get") + prop.getName(true); } }