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


Java CElementInfo类代码示例

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


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

示例1: getContainer

import com.sun.tools.xjc.model.CElementInfo; //导入依赖的package包/类
private MContainer getContainer(CClassInfoParent parent) {
	return parent.accept(new Visitor<MContainer>() {

		public MContainer onBean(CClassInfo bean) {
			return getTypeInfo(bean);
		}

		public MContainer onPackage(JPackage pkg) {
			return getPackage(pkg);
		}

		public MContainer onElement(CElementInfo element) {
			return getElementInfo(element);
		}
	});
}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:17,代码来源:XJCCMInfoFactory.java

示例2: getPackage

import com.sun.tools.xjc.model.CElementInfo; //导入依赖的package包/类
private MPackageInfo getPackage(CClassInfoParent parent) {

		return parent.accept(new Visitor<MPackageInfo>() {

			public MPackageInfo onBean(CClassInfo bean) {
				return getPackage(bean.parent());
			}

			public MPackageInfo onPackage(JPackage pkg) {
				return getPackage(pkg);
			}

			public MPackageInfo onElement(CElementInfo element) {
				return getPackage(element.parent);
			}
		});

	}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:19,代码来源:XJCCMInfoFactory.java

示例3: getPossibleTypes

import com.sun.tools.xjc.model.CElementInfo; //导入依赖的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

示例4: run

import com.sun.tools.xjc.model.CElementInfo; //导入依赖的package包/类
@Override
public boolean run(Outline outline, Options opt, ErrorHandler errorHandler) {
	for (final ClassOutline classOutline : outline.getClasses()) {
		if (classOutline.target.getElementName() != null) {
			processGlobalElement(classOutline);
		} else {
			processGlobalComplexType(classOutline);
		}
	}
	for (final CElementInfo elementInfo : outline.getModel()
			.getAllElements()) {
		final ElementOutline elementOutline = outline
				.getElement(elementInfo);
		if (elementOutline != null) {
			processGlobalJAXBElement(elementOutline);
		}
	}
	return true;
}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:20,代码来源:AutoInheritancePlugin.java

示例5: getTypeUse

import com.sun.tools.xjc.model.CElementInfo; //导入依赖的package包/类
public static TypeUse getTypeUse(ProcessModel processModel,
		CPropertyInfo propertyInfo) {
	if (propertyInfo instanceof CValuePropertyInfo) {
		return ((CValuePropertyInfo) propertyInfo).getTarget();
	} else if (propertyInfo instanceof CAttributePropertyInfo) {
		return ((CAttributePropertyInfo) propertyInfo).getTarget();
	} else {
		final CTypeInfo type = propertyInfo.ref().iterator().next();
		if (type instanceof CBuiltinLeafInfo) {
			if (propertyInfo.getAdapter() != null) {
				return TypeUseFactory.adapt((CBuiltinLeafInfo) type,
						propertyInfo.getAdapter());
			} else {
				return (CBuiltinLeafInfo) type;
			}
		} else if (type instanceof CElementInfo) {
			final CElementInfo elementInfo = (CElementInfo) type;
			return getTypeUse(processModel, elementInfo.getProperty());
		} else {
			throw new AssertionError("Unexpected type.");
		}
	}

}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:25,代码来源:TypeUseUtils.java

示例6: getTypeUse

import com.sun.tools.xjc.model.CElementInfo; //导入依赖的package包/类
public TypeUse getTypeUse(C context, CPropertyInfo propertyInfo) {
	if (propertyInfo instanceof CValuePropertyInfo) {
		return ((CValuePropertyInfo) propertyInfo).getTarget();
	} else if (propertyInfo instanceof CAttributePropertyInfo) {
		return ((CAttributePropertyInfo) propertyInfo).getTarget();
	} else {
		final CTypeInfo type = propertyInfo.ref().iterator().next();
		if (type instanceof CBuiltinLeafInfo) {
			if (propertyInfo.getAdapter() != null) {
				return TypeUseFactory.adapt((CBuiltinLeafInfo) type,
						propertyInfo.getAdapter());
			} else {
				return (CBuiltinLeafInfo) type;
			}
		} else if (type instanceof CElementInfo) {
			final CElementInfo elementInfo = (CElementInfo) type;
			return getTypeUse(context, elementInfo.getProperty());
		} else {
			throw new AssertionError("Unexpected type.");
		}
	}

}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:24,代码来源:DefaultGetTypes.java

示例7: run

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

	for (final CElementInfo elementInfo : outline.getModel()
			.getAllElements()) {
		final ElementOutline elementOutline = outline
				.getElement(elementInfo);
		if (elementOutline != null) {
			processElementOutline(elementOutline, options, errorHandler);
		}
	}

	for (final ClassOutline classOutline : outline.getClasses()) {
		processClassOutline(classOutline, options, errorHandler);
	}
	for (final EnumOutline enumOutline : outline.getEnums()) {
		processEnumOutline(enumOutline, options, errorHandler);
	}
	return true;
}
 
开发者ID:highsource,项目名称:jaxb2-annotate-plugin,代码行数:22,代码来源:AnnotatePlugin.java

示例8: findCustomizations

import com.sun.tools.xjc.model.CElementInfo; //导入依赖的package包/类
public static List<CPluginCustomization> findCustomizations(CElementInfo elementInfo, QName name) {
	final CCustomizations customizations = CustomizationUtils.getCustomizations(elementInfo);

	final List<CPluginCustomization> pluginCustomizations = new LinkedList<CPluginCustomization>();

	for (CPluginCustomization pluginCustomization : customizations) {
		if (fixNull(pluginCustomization.element.getNamespaceURI()).equals(name.getNamespaceURI())
				&& fixNull(pluginCustomization.element.getLocalName()).equals(name.getLocalPart())) {
			pluginCustomization.markAsAcknowledged();
			pluginCustomizations.add(pluginCustomization);
		}
	}

	return pluginCustomizations;
}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:16,代码来源:CustomizationUtils.java

示例9: findCustomization

import com.sun.tools.xjc.model.CElementInfo; //导入依赖的package包/类
public static CPluginCustomization findCustomization(CElementInfo elementInfo, QName name) {
	final CCustomizations customizations = CustomizationUtils.getCustomizations(elementInfo);
	final CPluginCustomization customization = customizations.find(name.getNamespaceURI(), name.getLocalPart());
	if (customization != null) {
		customization.markAsAcknowledged();
	}
	return customization;
}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:9,代码来源:CustomizationUtils.java

示例10: getElementInfo

import com.sun.tools.xjc.model.CElementInfo; //导入依赖的package包/类
protected CElementInfo getElementInfo() {
	final CReferencePropertyInfo referencePropertyInfo = (CReferencePropertyInfo) core;

	final Collection<CElement> elements = referencePropertyInfo
			.getElements();

	final CElement element = elements.iterator().next();

	final CElementInfo elementInfo = (CElementInfo) element.getType();
	return elementInfo;
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:12,代码来源:SingleWrappingReferenceField.java

示例11: unwrapCondifiton

import com.sun.tools.xjc.model.CElementInfo; //导入依赖的package包/类
@Override
public JExpression unwrapCondifiton(JExpression source) {

	final CReferencePropertyInfo core = (CReferencePropertyInfo) this.core;

	JExpression predicate = null;
	if (core.getElements().isEmpty()) {
		predicate = null;
	} else {
		for (CElement element : core.getElements()) {
			if (element instanceof CElementInfo) {
				CElementInfo elementinfo = (CElementInfo) element;

				final SingleWrappingReferenceElementInfoField field = new SingleWrappingReferenceElementInfoField(
						outline, prop, core, elementinfo);
				final JExpression condition = field
						.unwrapCondifiton(source);
				predicate = (predicate == null) ? condition : JOp.cor(
						predicate, condition);
			} else {
				// TODO Other cases currently not supported.
			}
		}
	}

	final JExpression isElement = codeModel.ref(JAXBContextUtils.class)
			.staticInvoke("isElement").arg(contextPath).arg(source);
	return predicate == null ? isElement : JOp.cand(JOp.not(predicate),
			isElement);
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:31,代码来源:SingleWrappingReferenceObjectField.java

示例12: getElementInfo

import com.sun.tools.xjc.model.CElementInfo; //导入依赖的package包/类
public CElementInfo getElementInfo(ProcessModel context,
		final CReferencePropertyInfo referencePropertyInfo) {
	final CElement element = context.getGetTypes()
			.getElements(context, referencePropertyInfo).iterator().next();
	assert element instanceof CElementInfo;

	final CElementInfo elementInfo = (CElementInfo) element;
	return elementInfo;
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:10,代码来源:WrapSingleSubstitutedElementReference.java

示例13: getTypeUse

import com.sun.tools.xjc.model.CElementInfo; //导入依赖的package包/类
public CBuiltinLeafInfo getTypeUse(ProcessModel context,
		CPropertyInfo propertyInfo) {
	
	final Collection<? extends CTypeInfo> types = context.getGetTypes().process(
			context, propertyInfo);

	final CElementInfo elementInfo = ((CElementInfo) types
			.iterator().next());

	final CBuiltinLeafInfo type = (CBuiltinLeafInfo) elementInfo
			.getContentType();

	return type;
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:15,代码来源:WrapSingleBuiltinReference.java

示例14: getPackageInfo

import com.sun.tools.xjc.model.CElementInfo; //导入依赖的package包/类
private CClassInfoParent.Package getPackageInfo(CClassInfoParent parent) {
	if (parent instanceof CClassInfoParent.Package) {
		return (Package) parent;
	} else if (parent instanceof CClassInfo) {
		return getPackageInfo(((CClassInfo) parent).parent());
	} else if (parent instanceof CElementInfo) {
		return getPackageInfo(((CElementInfo) parent).parent);
	} else {
		throw new AssertionError("Unexpexted class info parent [" + parent
				+ "].");
	}

}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:14,代码来源:DefaultIgnoring.java

示例15: buildClass2ElementMapping

import com.sun.tools.xjc.model.CElementInfo; //导入依赖的package包/类
/**
 * Build class name to element name mapping
 * 
 * @param outline, JAXB schema/code model
 * @return class name to element name map
 */
private static Map<String, QName> buildClass2ElementMapping(Outline outline) {
	Map<String, QName> mapping = new HashMap<String, QName>();
	for(CElementInfo ei : outline.getModel().getAllElements()) {
        JType exposedType = ei.getContentInMemoryType().toType(outline,Aspect.EXPOSED);
        mapping.put(exposedType.fullName(), ei.getElementName());
	}
	return mapping;
}
 
开发者ID:bulldog2011,项目名称:mxjc,代码行数:15,代码来源:ClassModelBuilder.java


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