Java Code Examples for com.sun.xml.xsom.XSComponent#apply()

The following examples show how to use com.sun.xml.xsom.XSComponent#apply() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XSFunctionApplier.java    From jaxb2-basics with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public T apply(Object target) {
	Validate.notNull(target);
	if (target instanceof XSComponent) {
		return ((XSComponent) target).apply(f);
	} else if (target instanceof SchemaComponentAware) {
		final XSComponent schemaComponent = ((SchemaComponentAware) target)
				.getSchemaComponent();
		if (schemaComponent == null) {
			return null;
		} else {
			return schemaComponent.apply(f);
		}
	} else {
		return null;
	}
}
 
Example 2
Source File: SimpleTypeAnalyzer.java    From hyperjaxb3 with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static Long getMinLength(XSComponent component) {
	if (component == null) {
		return null;
	} else {
		return component.apply(new MinLengthAnalyzer());
	}
}
 
Example 3
Source File: SimpleTypeAnalyzer.java    From hyperjaxb3 with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static Long getMaxLength(XSComponent component) {
	if (component == null) {
		return null;
	} else {
		return component.apply(new MaxLengthAnalyzer());
	}
}
 
Example 4
Source File: SimpleTypeAnalyzer.java    From hyperjaxb3 with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static Long getLength(XSComponent component) {
	if (component == null) {
		return null;
	} else {
		return component.apply(new LengthAnalyzer());
	}
}
 
Example 5
Source File: SimpleTypeAnalyzer.java    From hyperjaxb3 with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static Long getTotalDigits(XSComponent component) {
	if (component == null) {
		return null;
	} else {
		return component.apply(new TotalDigitsAnalyzer());
	}
}
 
Example 6
Source File: SimpleTypeAnalyzer.java    From hyperjaxb3 with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static Long getFractionDigits(XSComponent component) {
	if (component == null) {
		return null;
	} else {
		return component.apply(new FractionDigitsAnalyzer());
	}
}
 
Example 7
Source File: XSFinder.java    From jolie with GNU Lesser General Public License v2.1 4 votes vote down vote up
/**
 * Invokes this object as a visitor with the specified component.
 */
public final boolean find( XSComponent c ) {
    return c.apply(this);
}
 
Example 8
Source File: AbstractAxisImpl.java    From jolie with GNU Lesser General Public License v2.1 4 votes vote down vote up
public Iterator<T> iterator(XSComponent contextNode) {
    return contextNode.apply(this);
}
 
Example 9
Source File: NameGetter.java    From jolie with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * Gets the name of the specified component in the default locale.
 * This method is just a wrapper.
 */
public static String get( XSComponent comp ) {
    return (String)comp.apply(theInstance);
}