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


Java CPropertyInfo类代码示例

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


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

示例1: isFieldReference

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
private boolean isFieldReference(JFieldVar field, ClassOutline classOutline) {
    CPropertyInfo propertyInfo = classOutline.target.getProperty(field.name());
    Collection<? extends CTypeInfo> collection = propertyInfo.ref();
    if (collection == null || collection.isEmpty()) {
        return false;
    }
    CTypeInfo info = collection.iterator().next();
    if (info instanceof CClassInfo) {
        CClassInfo classInfo = (CClassInfo) info;
        if (OBJECT_REFERENCE_TYPE.equals(classInfo.getTypeName())) {
            return true;
        }
    }

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

示例2: getVersion

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
public Version getVersion(CPropertyInfo property) {
	final Persistence persistence = getModelCustomization(property);
	if (persistence.getDefaultVersion() == null) {
		throw new AssertionError("Default version element is not provided.");
	}
	final Version defaultVersion = (Version) persistence
			.getDefaultVersion().copyTo(new Version());
	final Version version;
	if (CustomizationUtils.containsCustomization(property,
			Customizations.VERSION_ELEMENT_NAME)) {
		version = findCustomization(property,
				Customizations.VERSION_ELEMENT_NAME, defaultVersion,
				this.<Version> merge());
	} else {
		version = defaultVersion;
	}
	return version;
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:19,代码来源:DefaultCustomizing.java

示例3: getPossibleTypes

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
public static Set<JType> getPossibleTypes(FieldOutline fieldOutline,
		Aspect aspect) {
	Validate.notNull(fieldOutline);
	final ClassOutline classOutline = fieldOutline.parent();
	final Outline outline = classOutline.parent();
	final CPropertyInfo propertyInfo = fieldOutline.getPropertyInfo();

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

	if (propertyInfo.getAdapter() != null) {
		types.add(propertyInfo.getAdapter().customType.toType(fieldOutline
				.parent().parent(), aspect));
	} else if (propertyInfo.baseType != null) {
		types.add(propertyInfo.baseType);
	} else {
		Collection<? extends CTypeInfo> typeInfos = propertyInfo.ref();
		for (CTypeInfo typeInfo : typeInfos) {
			types.addAll(getPossibleTypes(outline, aspect, typeInfo));
		}
	}
	return types;
}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:23,代码来源:FieldUtils.java

示例4: process

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
public Collection<CPropertyInfo> process(ProcessModel context,
		CClassInfo classInfo) {

	final Collection<CPropertyInfo> version = new LinkedList<CPropertyInfo>();

	if (classInfo.getBaseClass() != null) {
		version.addAll(process(context, classInfo.getBaseClass()));
	}

	if (!CustomizationUtils.containsCustomization(classInfo,
			Customizations.IGNORED_ELEMENT_NAME)) {

		for (CPropertyInfo propertyInfo : classInfo.getProperties()) {
			if (CustomizationUtils.containsCustomization(propertyInfo,
					Customizations.VERSION_ELEMENT_NAME)
					&& !CustomizationUtils.containsCustomization(
							propertyInfo,
							Customizations.IGNORED_ELEMENT_NAME)) {
				version.add(propertyInfo);
			}
		}
	}
	return version;
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:25,代码来源:GetVersionPropertyInfos.java

示例5: generateField

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
@Override
protected FieldOutline generateField(final ProcessModel context,
		CPropertyInfo core, ClassOutlineImpl classOutline,
		CPropertyInfo propertyInfo) {

	final JaxbContext jaxbContext = context.getCustomizing()
			.getJaxbContext(propertyInfo);

	final String contextPath = (jaxbContext == null || jaxbContext
			.getContextPath() == null) ? OutlineUtils
			.getContextPath(classOutline.parent()) : jaxbContext
			.getContextPath();

	final boolean _final = (jaxbContext == null
			|| jaxbContext.getField() == null || jaxbContext.getField()
			.isFinal() == null) ? true : jaxbContext.getField().isFinal();

	final SingleMarshallingField fieldOutline = new SingleMarshallingField(
			classOutline, propertyInfo, core, contextPath, _final);
	fieldOutline.generateAccessors();
	return fieldOutline;
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:23,代码来源:AdaptSingleWildcardNonReference.java

示例6: getExtensionsField

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
static
private FieldOutline getExtensionsField(final ClassOutline clazz){
	FieldFilter filter = new FieldFilter(){

		@Override
		public boolean accept(FieldOutline field){
			CPropertyInfo propertyInfo = field.getPropertyInfo();

			if(("extensions").equals(propertyInfo.getName(false)) && propertyInfo.isCollection()){
				JType elementType = CodeModelUtil.getElementType(field.getRawType());

				return checkType(elementType, "org.dmg.pmml.Extension");
			}

			return false;
		}
	};

	return CodeModelUtil.findField(clazz.getDeclaredFields(), filter);
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:21,代码来源:PMMLPlugin.java

示例7: createAttributePropertyInfo

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
public CPropertyInfo createAttributePropertyInfo(String propertyName,
		XSComponent source, TypeUse propertyType, QName propertyQName,
		CollectionMode collectionMode, CCustomizations customizations) {

	final TypeUse typeUse = collectionMode.isRepeated() ?

	new DefaultTypeUse(propertyType.getInfo(), true,
			propertyType.idUse(), propertyType.getExpectedMimeType(),
			propertyType.getAdapterUse()) : propertyType;

	final CAttributePropertyInfo propertyInfo = new CAttributePropertyInfo(
			propertyName, source,

			customizations, null, propertyQName, typeUse, typeUse.getInfo()
					.getTypeName(), false);
	return propertyInfo;
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:18,代码来源:AbstractAdaptPropertyInfo.java

示例8:

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
public Integer createColumn$Precision(CPropertyInfo property) {
	final Integer precision;
	final Long totalDigits = SimpleTypeAnalyzer.getTotalDigits(property
			.getSchemaComponent());
	final Long fractionDigits = SimpleTypeAnalyzer
			.getFractionDigits(property.getSchemaComponent());
	if (totalDigits != null) {
		if (fractionDigits != null) {
			precision = totalDigits.intValue() + fractionDigits.intValue();
		} else {
			precision = totalDigits.intValue() * 2;
		}
	} else {
		precision = null;
	}
	return precision;
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:18,代码来源:DefaultCustomizing.java

示例9: SingleWrappingClassInfoField

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
public SingleWrappingClassInfoField(ClassOutlineImpl context,
		CPropertyInfo prop, CPropertyInfo core, CClassInfo classInfo) {
	super(context, prop, core);

	// assert prop instanceof CElementPropertyInfo;
	//		
	// final CElementPropertyInfo elementPropertyInfo =
	// (CElementPropertyInfo) prop;
	//		
	// assert elementPropertyInfo.getTypes().size() == 1;
	//		
	// final CTypeRef typeRef = elementPropertyInfo.getTypes().get(0);

	this.classInfo = classInfo;
	this._class = classInfo.toType(context.parent(), Aspect.EXPOSED);
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:17,代码来源:SingleWrappingClassInfoField.java

示例10: createElementPropertyInfo

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
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;
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:20,代码来源:AbstractAdaptPropertyInfo.java

示例11: process

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
public TypeUse process(ProcessModel context, CPropertyInfo propertyInfo) {
	// propertyInfo.g
	final TypeUse type = context.getGetTypes().getTypeUse(context,
			propertyInfo);
	final XSComponent schemaComponent = propertyInfo.getSchemaComponent();

	if (schemaComponent != null) {
		final List<QName> typeNames = TypeUtils
				.getTypeNames(schemaComponent);

		for (QName typeName : typeNames) {
			final PropertyType propertyType = new PropertyType(type,
					typeName);
			if (adapters.containsKey(propertyType)) {
				final TypeUse createPropertyInfos = adapters
						.get(propertyType);
				return createPropertyInfos;
			}
		}
		return adapters.get(new PropertyType(type));

	} else {
		return adapters.get(new PropertyType(type));
	}
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:26,代码来源:AdaptBuiltinTypeUse.java

示例12: getCreatePropertyInfos

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
@Override
public CreatePropertyInfos getCreatePropertyInfos(ProcessModel context,
		CPropertyInfo propertyInfo) {

	final CBuiltinLeafInfo originalTypeUse = getTypeUse(context,
			propertyInfo);

	final TypeUse adaptingTypeUse = context.getAdaptBuiltinTypeUse()
			.process(context, propertyInfo);

	if (adaptingTypeUse == originalTypeUse
			|| adaptingTypeUse.getAdapterUse() == null) {
		logger.debug("No adaptation required.");
		return CreateNoPropertyInfos.INSTANCE;

	} else {
		return new AdaptCollectionBuiltinNonReference(adaptingTypeUse);
	}
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:20,代码来源:WrapCollectionBuiltinNonReference.java

示例13: process

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
public Collection<CClassInfo> process(ProcessModel context,
		CClassInfo classInfo) {

	final Collection<CPropertyInfo> newProperties = context
			.getProcessPropertyInfos().process(context, classInfo);

	final Collection<CClassInfo> classes = new HashSet<CClassInfo>(1);

	classes.add(classInfo);

	for (CPropertyInfo newProperty : newProperties) {
		if (newProperty.parent() == null) {
			throw new IllegalStateException("Property ["
					+ newProperty.getName(true)
					+ "] does not have a parent.");
		}
		classes.add((CClassInfo) newProperty.parent());
	}
	
	classes.addAll(context.getCreateIdClass().process(context, classInfo));

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

示例14: getOneToMany

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
public OneToMany getOneToMany(CPropertyInfo property) {

		final OneToMany coneToMany;
		final Persistence persistence = getModelCustomization(property);
		if (persistence.getDefaultOneToMany() == null) {
			throw new AssertionError(
					"Default one-to-many element is not provided.");
		}
		final OneToMany defaultOneToMany = (OneToMany) persistence
				.getDefaultOneToMany().copyTo(new OneToMany());
		if (CustomizationUtils.containsCustomization(property,
				Customizations.ONE_TO_MANY_ELEMENT_NAME)) {
			coneToMany = findCustomization(property,
					Customizations.ONE_TO_MANY_ELEMENT_NAME, defaultOneToMany,
					new Merge<OneToMany>() {
						public void merge(OneToMany value,
								OneToMany defaultValue) {
							DefaultCustomizing.this.merge(value, defaultValue);
						}
					});

		} else {
			return defaultOneToMany;
		}
		return coneToMany;
	}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:27,代码来源:DefaultCustomizing.java

示例15: ref

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
public Collection<? extends CTypeInfo> ref(C context,
		CPropertyInfo propertyInfo) {
	final Collection<? extends CTypeInfo> types = propertyInfo.ref();
	final JType baseType = propertyInfo.baseType;
	final ID id = propertyInfo.id();

	final CTypeInfo parent = propertyInfo.parent();
	if (ID.IDREF.equals(id)) {
		if (parent instanceof CClassInfo) {
			final CClassInfo parentClassInfo = (CClassInfo) parent;
			final String fullName = baseType.fullName();
			for (CClassInfo possibleClassInfo : parentClassInfo.model
					.beans().values()) {
				final String possibleFullName = possibleClassInfo
						.fullName();
				if (fullName != null && fullName.equals(possibleFullName)) {
					return Collections.singleton(possibleClassInfo);
				}
			}
		}
	}
	return types;
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:24,代码来源:DefaultGetTypes.java


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