当前位置: 首页>>代码示例>>Java>>正文


Java Outline类代码示例

本文整理汇总了Java中com.sun.tools.xjc.outline.Outline的典型用法代码示例。如果您正苦于以下问题:Java Outline类的具体用法?Java Outline怎么用?Java Outline使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Outline类属于com.sun.tools.xjc.outline包,在下文中一共展示了Outline类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
@Override
public boolean run(Outline outline, Options options, ErrorHandler errorHandler) {
    // for each generated classes
    for (ClassOutline generatedClassOutline : outline.getClasses()) {
        JDefinedClass generatedClass = generatedClassOutline.implClass;
        if (!isAbstractClass(generatedClass) &&
                !generatedClass.fields().isEmpty()) {
            boolean commandExecuted = false;
            for (Command command : commands.values()) {
                if (command.isEnabled()) {
                    command.editGeneratedClass(generatedClass);
                    commandExecuted = true;
                }
            }

            if (!commandExecuted) {
                defaultCommand.editGeneratedClass(generatedClass);
            }
        }
    }
    return true;
}
 
开发者ID:svzdvd,项目名称:jaxb-lombok-plugin,代码行数:23,代码来源:LombokPlugin.java

示例2: run

import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
@Override
public boolean run(Outline outline, Options opt, ErrorHandler errorHandler) throws Exception {
    PluginImpl clonePlugin = new PluginImpl();
    clonePlugin.run(outline, opt, errorHandler);

    Set<Map.Entry<NClass, CClassInfo>> set = outline.getModel().beans().entrySet();
    for (Map.Entry<NClass, CClassInfo> entry : set) {
        ClassOutline classOutline = outline.getClazz(entry.getValue());
        if (isPrism(classOutline)) {
            removeConstructors(classOutline);
            removeCloneableMethod(classOutline);

            removePrivateStaticCopyMethods(classOutline);
            createCloneMethod(classOutline);
        }
    }

    return true;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:20,代码来源:CloneProcessor.java

示例3: removeCustomGeneratedMethod

import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
/**
 * remove generated equals methods from classes which extends from prism containers/objects
 */
private void removeCustomGeneratedMethod(Outline outline) {
    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 = getCClassInfoQName(entry.getValue());
        if (qname == null || (!hasParentAnnotation(classOutline, A_PRISM_OBJECT)
                && !hasParentAnnotation(classOutline, A_PRISM_CONTAINER))) {
            continue;
        }

        JDefinedClass definedClass = classOutline.implClass;
        Iterator<JClass> iterator = definedClass._implements();
        while (iterator.hasNext()) {
            JClass clazz = iterator.next();
            if (clazz.equals(CLASS_MAP.get(Equals.class)) || clazz.equals(CLASS_MAP.get(HashCode.class))) {
                iterator.remove();
            }
        }

        boolean isMidpointContainer = hasParentAnnotation(classOutline, A_PRISM_OBJECT);
        removeOldCustomGeneratedEquals(classOutline, isMidpointContainer);
        removeOldCustomGenerated(classOutline, isMidpointContainer, METHOD_HASH_CODE);
        removeOldCustomGenerated(classOutline, isMidpointContainer, METHOD_TO_STRING);
    }
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:29,代码来源:SchemaProcessor.java

示例4: addComplextType

import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
private void addComplextType(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 var = namespaceFields.get(qname.getNamespaceURI());
        if (var != null) {
            createQNameDefinition(outline, classOutline.implClass, COMPLEX_TYPE_FIELD_NAME, var, qname);
        } else {
            createPSFField(outline, classOutline.implClass, COMPLEX_TYPE_FIELD_NAME, qname);
        }
    }
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:18,代码来源:SchemaProcessor.java

示例5: AbstractSinglePropertyOutline

import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
public AbstractSinglePropertyOutline(Outline outline,
		MClassOutline classOutline, MPropertyInfo<NType, NClass> target) {
	super(outline, classOutline, target);
	this.field = generateField();
	this.getter = generateGetter();
	this.setter = generateSetter();
}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:8,代码来源:AbstractSinglePropertyOutline.java

示例6: AbstractPropertyOutline

import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
public AbstractPropertyOutline(Outline outline, MClassOutline classOutline,
		MPropertyInfo<NType, NClass> target) {
	Validate.notNull(outline);
	Validate.notNull(classOutline);
	Validate.notNull(target);
	this.outline = outline;
	this.modelOutline = classOutline.getParent();
	this.classOutline = classOutline;
	this.propertyInfo = target;
	this.codeModel = classOutline.getParent().getCode();

	this.referenceClass = classOutline.getReferenceCode();
	this.implementationClass = classOutline.getImplementationCode();
	this.implementationReferenceClass = classOutline
			.getImplementationReferenceCode();

	this.type = generateType();
}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:19,代码来源:AbstractPropertyOutline.java

示例7: getClazz

import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
protected NClass getClazz(final Class<?> _clas) {
	return new NClass() {

		@Override
		public boolean isBoxedType() {
			return false;
		}

		@Override
		public String fullName() {
			return _clas.getName();
		}

		@Override
		public JClass toType(Outline o, Aspect aspect) {
			return o.getCodeModel().ref(_clas);
		}

		@Override
		public boolean isAbstract() {
			return false;
		}
	};
}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:25,代码来源:XJCCMInfoFactory.java

示例8: createListType

import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
@Override
protected NType createListType(final NType elementType) {

	return new NClass() {

		public boolean isBoxedType() {
			return false;
		}

		public String fullName() {
			return List.class.getName();
		}

		public JClass toType(Outline o, Aspect aspect) {
			return o.getCodeModel().ref(List.class)
					.narrow(elementType.toType(o, aspect).boxify());
		}

		public boolean isAbstract() {
			return false;
		}
	};
}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:24,代码来源:XJCCMInfoFactory.java

示例9: getPossibleTypes

import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
public static Set<JType> getPossibleTypes(Outline outline, Aspect aspect,
		CTypeInfo typeInfo) {

	final Set<JType> types = new HashSet<JType>();

	types.add(typeInfo.getType().toType(outline, aspect));
	if (typeInfo instanceof CElementInfo) {

		final CElementInfo elementInfo = (CElementInfo) typeInfo;
		for (CElementInfo substitutionMember : elementInfo
				.getSubstitutionMembers()) {
			types.addAll(getPossibleTypes(outline, aspect,
					substitutionMember));
		}
	}
	return types;
}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:18,代码来源:FieldUtils.java

示例10: generateCode

import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
protected Outline generateCode(final Model model)
		throws MojoExecutionException {
	if (getVerbose()) {
		getLog().info("Compiling input schema(s)...");
	}

	final Outline outline = model.generateCode(model.options,
			new LoggingErrorReceiver("Error while generating code.",
					getLog(), getVerbose()));
	if (outline == null) {
		throw new MojoExecutionException(
				"Failed to compile input schema(s)!  Error messages should have been provided.");
	} else {
		return outline;
	}
}
 
开发者ID:highsource,项目名称:maven-jaxb2-plugin,代码行数:17,代码来源:XJC20Mojo.java

示例11: run

import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
@Override
public boolean run(Outline outline, Options opt, ErrorHandler errorHandler) {

	for (final PackageOutline packageOutline : outline
			.getAllPackageContexts()) {
		final StringBuilder sb = new StringBuilder();
		for (final ClassOutline classOutline : packageOutline.getClasses()) {
			sb.append(CodeModelUtils.getLocalClassName(classOutline.ref));
			sb.append("\n");
		}

		final JTextFile indexFile = new JTextFile("jaxb.index");
		indexFile.setContents(sb.toString());
		packageOutline._package().addResourceFile(indexFile);
	}
	return true;
}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:18,代码来源:JaxbIndexPlugin.java

示例12: run

import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
@Override
public boolean run(final Outline outline, final Options opt, final ErrorHandler errorHandler) throws SAXException {
	final PluginContext pluginContext = PluginContext.get(outline, opt, errorHandler);
	if (this.extended && this.generateTools) {
		pluginContext.writeSourceFile(PropertyInfo.class);
		pluginContext.writeSourceFile(SinglePropertyInfo.class);
		pluginContext.writeSourceFile(CollectionPropertyInfo.class);
		pluginContext.writeSourceFile(IndirectCollectionPropertyInfo.class);
		pluginContext.writeSourceFile(IndirectPrimitiveCollectionPropertyInfo.class);
		pluginContext.writeSourceFile(PropertyVisitor.class);
		pluginContext.writeSourceFile(Property.class);
		pluginContext.writeSourceFile(SingleProperty.class);
		pluginContext.writeSourceFile(CollectionProperty.class);
		pluginContext.writeSourceFile(IndirectCollectionProperty.class);
		pluginContext.writeSourceFile(IndirectPrimitiveCollectionProperty.class);
		pluginContext.writeSourceFile(ItemProperty.class);
	}
	for (final ClassOutline classOutline : outline.getClasses()) {
		generateMetaClass(pluginContext, classOutline, errorHandler);
	}
	return true;
}
 
开发者ID:mklemm,项目名称:jaxb2-rich-contract-plugin,代码行数:23,代码来源:MetaPlugin.java

示例13: generateCode

import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
protected Outline generateCode(final Model model)
		throws MojoExecutionException {
	if (getVerbose()) {
		getLog().info("Compiling input schema(s)...");
	}

	final Outline outline = model.generateCode(model.options,
			new LoggingErrorReceiver("Error while generating code.",
					getLog(), getVerbose()));
	if (outline == null) {
		throw new MojoExecutionException(
				"Failed to compile input schema(s)! Error messages should have been provided.");
	} else {
		return outline;
	}
}
 
开发者ID:highsource,项目名称:maven-jaxb2-plugin,代码行数:17,代码来源:XJC22Mojo.java

示例14: process

import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
public Collection<ClassOutline> process(EjbPlugin context, Outline outline,
		Options options) throws Exception {
	logger.debug("Processing outline with context path ["
			+ OutlineUtils.getContextPath(outline) + "].");

	final Collection<? extends ClassOutline> classes = outline.getClasses();
	final Collection<ClassOutline> processedClassOutlines = new ArrayList<ClassOutline>(
			classes.size());

	for (final ClassOutline classOutline : classes) {
		if (!getIgnoring()
				.isClassOutlineIgnored(getMapping(), classOutline)) {
			final ClassOutline processedClassOutline = process(this,
					classOutline, options);
			if (processedClassOutline != null) {
				processedClassOutlines.add(processedClassOutline);
			}
		}
	}
	return processedClassOutlines;
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:22,代码来源:MarshalMappings.java

示例15: getPersistenceUnitName

import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
public String getPersistenceUnitName(Mapping context, Outline outline) {
	final StringBuffer sb = new StringBuffer();
	boolean first = true;

	for (final Iterator<? extends PackageOutline> packageOutlines = outline
			.getAllPackageContexts().iterator(); packageOutlines.hasNext();) {
		final PackageOutline packageOutline = packageOutlines.next();
		if (!getIgnoring().isPackageOutlineIgnored(context, outline,
				packageOutline)) {
			if (!first) {
				sb.append(':');
			} else {
				first = false;
			}
			final String packageName = packageOutline._package().name();
			sb.append(packageName);
		}

	}
	return sb.toString();
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:22,代码来源:DefaultNaming.java


注:本文中的com.sun.tools.xjc.outline.Outline类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。