• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CPropertyInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: getGetterMethodName

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


示例17: getMethodName

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
public static String getMethodName(ClassOutline classOutline, JFieldVar field, String prefix) {
      CPropertyInfo prop = classOutline.target.getProperty(field.name());
      if (prop == null) {
	throw new IllegalStateException("No property info for classOutline=" + classOutline.target.fullName() + ", field=" + field.name()+" of " + field.type());
}
      return prefix + prop.getName(true);
  }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:8,代码来源:ProcessorUtils.java


示例18: hasAnnotation

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
public static BIDeclaration hasAnnotation(ClassOutline classOutline, JFieldVar field, QName qname) {
    CPropertyInfo propertyInfo = classOutline.target.getProperty(field.name());
    if (propertyInfo == null || !(propertyInfo.getSchemaComponent() instanceof XSParticle)) {
        return null;
    }
    XSParticle particle = (XSParticle)propertyInfo.getSchemaComponent();
    if (particle.getTerm() == null) {
        return null;
    }
    XSAnnotation annotation = particle.getTerm().getAnnotation(false);
    
    return hasAnnotation(annotation, qname);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:14,代码来源:ProcessorUtils.java


示例19: createAnonListClass

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
@NotNull
private JDefinedClass createAnonListClass(JFieldVar field, ClassOutline classOutline) {
    JDefinedClass anonymous;
    try {
        CPropertyInfo propertyInfo = classOutline.target.getProperty(field.name());
        anonymous = classOutline.implClass._class(JMod.PRIVATE | JMod.STATIC, "Anon" + propertyInfo.getName(true));
        JDocComment comment = anonymous.javadoc();
        comment.append("TODO Can't be anonymous because of NPE bug in CodeModel generator, will be fixed later.");
    } catch (JClassAlreadyExistsException ex) {
        throw new RuntimeException(ex.getMessage(), ex);
    }
    return anonymous;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:14,代码来源:SchemaProcessor.java


示例20: getReferencedField

import com.sun.tools.xjc.model.CPropertyInfo; //导入依赖的package包/类
private JFieldVar getReferencedField(JFieldVar field, ClassOutline classOutline) {
    QName qname = getFieldReferenceUseAnnotationQName(field, classOutline);
    CPropertyInfo propertyInfo = classOutline.target.getProperty(qname.getLocalPart());
    if (propertyInfo == null) {
    	throw new IllegalArgumentException("No property "+qname.getLocalPart()+" in "+classOutline.target);
    }
    return classOutline.implClass.fields().get(propertyInfo.getName(false));
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:9,代码来源:SchemaProcessor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CircuitBreaker类代码示例发布时间:2022-05-22
下一篇:
Java DependencyManager类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap