All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jvnet.jaxb2_commons.xml.bind.model.concrete.CMList Maven / Gradle / Ivy

The newest version!
package org.jvnet.jaxb2_commons.xml.bind.model.concrete;

import java.text.MessageFormat;

import javax.xml.namespace.QName;

import org.jvnet.jaxb2_commons.lang.Validate;
import org.jvnet.jaxb2_commons.xml.bind.model.MCustomizations;
import org.jvnet.jaxb2_commons.xml.bind.model.MList;
import org.jvnet.jaxb2_commons.xml.bind.model.MTypeInfo;
import org.jvnet.jaxb2_commons.xml.bind.model.MTypeInfoVisitor;

public class CMList implements MList {

	private final MTypeInfo itemTypeInfo;
	private final T targetType;
	private final MCustomizations customizations = new CMCustomizations();
	private final QName typeName;

	public CMList(T targetType, MTypeInfo itemTypeInfo, QName typeName) {
		Validate.notNull(targetType);
		Validate.notNull(itemTypeInfo);
		this.targetType = targetType;
		this.itemTypeInfo = itemTypeInfo;
		this.typeName = typeName;
	}

	public MCustomizations getCustomizations() {
		return customizations;
	}

	public T getTargetType() {
		return targetType;
	}
	
	@Override
	public QName getTypeName() {
		return typeName;
	}
	
	@Override
	public boolean isSimpleType() {
		return true;
	}

	public MTypeInfo getItemTypeInfo() {
		return itemTypeInfo;
	}

	@Override
	public String toString() {
		return MessageFormat.format("List [{0}]", getItemTypeInfo());
	}

	public  V acceptTypeInfoVisitor(MTypeInfoVisitor visitor) {
		return visitor.visitList(this);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy