本文整理匯總了Java中javax.xml.bind.annotation.XmlElementRef類的典型用法代碼示例。如果您正苦於以下問題:Java XmlElementRef類的具體用法?Java XmlElementRef怎麽用?Java XmlElementRef使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
XmlElementRef類屬於javax.xml.bind.annotation包,在下文中一共展示了XmlElementRef類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isRequired
import javax.xml.bind.annotation.XmlElementRef; //導入依賴的package包/類
/**
* Reads the value of {@code XmlElementRef.required()}.
*
* If we are working as 2.1 RI, this defaults to true.
*/
private boolean isRequired(XmlElementRef ref) {
if(!is2_2) return true;
try {
return ref.required();
} catch(LinkageError e) {
is2_2 = false;
return true; // the value defaults to true
}
}
示例2: getEffectiveNamespaceFor
import javax.xml.bind.annotation.XmlElementRef; //導入依賴的package包/類
private String getEffectiveNamespaceFor(XmlElementRef r) {
String nsUri = r.namespace();
XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
if(xs!=null && xs.attributeFormDefault()== XmlNsForm.QUALIFIED) {
// JAX-RPC doesn't want the default namespace URI swapping to take effect to
// local "unqualified" elements. UGLY.
if(nsUri.length()==0)
nsUri = parent.builder.defaultNsUri;
}
return nsUri;
}
示例3: getIncludeFiles
import javax.xml.bind.annotation.XmlElementRef; //導入依賴的package包/類
/**
* Getter for property includeFiles.
* This is an array of filters identifying files that should be selected.
* A file is selected if at least one filter matches.
* @return Value of property includeFiles.
*/
@XmlElementWrapper(name="IncludeFiles",
namespace=XmlConfigUtils.NAMESPACE)
@XmlElementRef
public FileMatch[] getIncludeFiles() {
synchronized(includeFiles) {
return includeFiles.toArray(new FileMatch[0]);
}
}
示例4: getExcludeFiles
import javax.xml.bind.annotation.XmlElementRef; //導入依賴的package包/類
/**
* Getter for property excludeFiles.
* This is an array of filters identifying files that should be excluded.
* A file is excluded if at least one filter matches.
* @return Value of property excludeFiles.
*/
@XmlElementWrapper(name="ExcludeFiles",
namespace=XmlConfigUtils.NAMESPACE)
@XmlElementRef
public FileMatch[] getExcludeFiles() {
synchronized(excludeFiles) {
return excludeFiles.toArray(new FileMatch[0]);
}
}
示例5: lookupSubstitutionUncached
import javax.xml.bind.annotation.XmlElementRef; //導入依賴的package包/類
private Field lookupSubstitutionUncached(Class beanClass, Method elementMethodInObjectFactory) {
XmlElementDecl xmlElementDecl = elementMethodInObjectFactory.getAnnotation(XmlElementDecl.class);
if (xmlElementDecl == null) {
return null;
}
final String substitutionHeadName = xmlElementDecl.substitutionHeadName();
return findField(beanClass, field -> {
XmlElementRef xmlElementRef = field.getAnnotation(XmlElementRef.class);
return xmlElementRef != null && xmlElementRef.name().equals(substitutionHeadName);
});
}
示例6: processRefWhenClauses
import javax.xml.bind.annotation.XmlElementRef; //導入依賴的package包/類
/**
* Special for processing an @XmlElementRef when field
*/
private void processRefWhenClauses(RoundEnvironment roundEnv, TypeElement originalClassType, XmlElementRef elementRef,
VariableElement fieldElement, String fieldName, Set<EipOption> eipOptions, String prefix) {
Elements elementUtils = processingEnv.getElementUtils();
if ("whenClauses".equals(fieldName)) {
String kind = "element";
String name = elementRef.name();
if (isNullOrEmpty(name) || "##default".equals(name)) {
name = fieldName;
}
name = prefix + name;
TypeMirror fieldType = fieldElement.asType();
String fieldTypeName = fieldType.toString();
// find javadoc from original class as it will override the setExpression method where we can provide the javadoc for the given EIP
String docComment = findJavaDoc(elementUtils, fieldElement, fieldName, name, originalClassType, true);
boolean deprecated = fieldElement.getAnnotation(Deprecated.class) != null;
// indicate that this element is one of when
Set<String> oneOfTypes = new HashSet<String>();
oneOfTypes.add("when");
EipOption ep = new EipOption(name, kind, fieldTypeName, false, "", docComment, deprecated, false, null, true, oneOfTypes);
eipOptions.add(ep);
}
}
示例7: getControlWordCasMappings
import javax.xml.bind.annotation.XmlElementRef; //導入依賴的package包/類
/**
* Gets the mappings from rtf control words to UIMA annotations.
*
* @return list containing mappings
*/
@XmlElementWrapper(required = true)
@XmlElementRef(name = "controlWordCasMapping")
@Nullable
public List<ControlWordCasMapping> getControlWordCasMappings() {
return controlWordCasMappings;
}
示例8: getDestinationCasMappings
import javax.xml.bind.annotation.XmlElementRef; //導入依賴的package包/類
/**
* Gets the mappings from rtf destinations to UIMA CAS views.
*
* @return list of the mappings.
*/
@XmlElementWrapper(required = true)
@XmlElementRef(name = "destinationCasMapping")
@Nullable
public List<DestinationCasMapping> getDestinationCasMappings() {
return destinationCasMappings;
}
示例9: setItem
import javax.xml.bind.annotation.XmlElementRef; //導入依賴的package包/類
@XmlElementRefs({
@XmlElementRef(name = "OffeneLeistung", type = VertecOffeneLeistung.class),
@XmlElementRef(name = "VerrechneteLeistung", type = VertecVerrechneteLeistung.class),
@XmlElementRef(name = "ProjektBearbeiter", type = VertecProjektBearbeiter.class),
@XmlElementRef(name = "Projekt", type = VertecProject.class),
@XmlElementRef(name = "ProjektPhase", type = VertecPhase.class)})
@XmlAnyElement
public void setItem(T item)
{
this.item = item;
}
示例10: setOutputs
import javax.xml.bind.annotation.XmlElementRef; //導入依賴的package包/類
/**
* Outputs are processors that determines how messages are processed by this route.
*/
@XmlElementRef
public void setOutputs(List<ProcessorDefinition<?>> outputs) {
this.outputs = outputs;
if (outputs != null) {
for (ProcessorDefinition<?> output : outputs) {
configureChild(output);
}
}
}
示例11: processRoutes
import javax.xml.bind.annotation.XmlElementRef; //導入依賴的package包/類
/**
* Special for processing an @XmlElementRef routes field
*/
private void processRoutes(RoundEnvironment roundEnv, TypeElement originalClassType, XmlElementRef elementRef,
VariableElement fieldElement, String fieldName, Set<EipOption> eipOptions, String prefix) {
if ("routes".equals(fieldName)) {
TypeMirror fieldType = fieldElement.asType();
String fieldTypeName = fieldType.toString();
Set<String> oneOfTypes = new TreeSet<String>();
oneOfTypes.add("route");
EipOption ep = new EipOption("routes", "element", fieldTypeName, false, "", "Contains the Camel routes", false, false, null, true, oneOfTypes);
eipOptions.add(ep);
}
}
示例12: processRests
import javax.xml.bind.annotation.XmlElementRef; //導入依賴的package包/類
/**
* Special for processing an @XmlElementRef rests field
*/
private void processRests(RoundEnvironment roundEnv, TypeElement originalClassType, XmlElementRef elementRef,
VariableElement fieldElement, String fieldName, Set<EipOption> eipOptions, String prefix) {
if ("rests".equals(fieldName)) {
TypeMirror fieldType = fieldElement.asType();
String fieldTypeName = fieldType.toString();
Set<String> oneOfTypes = new TreeSet<String>();
oneOfTypes.add("rest");
EipOption ep = new EipOption("rests", "element", fieldTypeName, false, "", "Contains the rest services defined using the rest-dsl", false, false, null, true, oneOfTypes);
eipOptions.add(ep);
}
}
示例13: processOutputs
import javax.xml.bind.annotation.XmlElementRef; //導入依賴的package包/類
/**
* Special for processing an @XmlElementRef outputs field
*/
private void processOutputs(RoundEnvironment roundEnv, TypeElement originalClassType, XmlElementRef elementRef,
VariableElement fieldElement, String fieldName, Set<EipOption> eipOptions, String prefix) {
if ("outputs".equals(fieldName) && supportOutputs(originalClassType)) {
String kind = "element";
String name = elementRef.name();
if (isNullOrEmpty(name) || "##default".equals(name)) {
name = fieldName;
}
name = prefix + name;
TypeMirror fieldType = fieldElement.asType();
String fieldTypeName = fieldType.toString();
// gather oneOf which extends any of the output base classes
Set<String> oneOfTypes = new TreeSet<String>();
// find all classes that has that superClassName
Set<TypeElement> children = new LinkedHashSet<TypeElement>();
for (String superclass : ONE_OF_OUTPUTS) {
findTypeElementChildren(roundEnv, children, superclass);
}
for (TypeElement child : children) {
XmlRootElement rootElement = child.getAnnotation(XmlRootElement.class);
if (rootElement != null) {
String childName = rootElement.name();
if (childName != null) {
oneOfTypes.add(childName);
}
}
}
// remove some types which are not intended as an output in eips
oneOfTypes.remove("route");
EipOption ep = new EipOption(name, kind, fieldTypeName, true, "", "", false, false, null, true, oneOfTypes);
eipOptions.add(ep);
}
}
示例14: processVerbs
import javax.xml.bind.annotation.XmlElementRef; //導入依賴的package包/類
/**
* Special for processing an @XmlElementRef verbs field (rest-dsl)
*/
private void processVerbs(RoundEnvironment roundEnv, TypeElement originalClassType, XmlElementRef elementRef,
VariableElement fieldElement, String fieldName, Set<EipOption> eipOptions, String prefix) {
Elements elementUtils = processingEnv.getElementUtils();
if ("verbs".equals(fieldName) && supportOutputs(originalClassType)) {
String kind = "element";
String name = elementRef.name();
if (isNullOrEmpty(name) || "##default".equals(name)) {
name = fieldName;
}
name = prefix + name;
TypeMirror fieldType = fieldElement.asType();
String fieldTypeName = fieldType.toString();
String docComment = findJavaDoc(elementUtils, fieldElement, fieldName, name, originalClassType, true);
// gather oneOf which extends any of the output base classes
Set<String> oneOfTypes = new TreeSet<String>();
// find all classes that has that superClassName
Set<TypeElement> children = new LinkedHashSet<TypeElement>();
for (String superclass : ONE_OF_VERBS) {
findTypeElementChildren(roundEnv, children, superclass);
}
for (TypeElement child : children) {
XmlRootElement rootElement = child.getAnnotation(XmlRootElement.class);
if (rootElement != null) {
String childName = rootElement.name();
if (childName != null) {
oneOfTypes.add(childName);
}
}
}
EipOption ep = new EipOption(name, kind, fieldTypeName, true, "", docComment, false, false, null, true, oneOfTypes);
eipOptions.add(ep);
}
}
示例15: value
import javax.xml.bind.annotation.XmlElementRef; //導入依賴的package包/類
public XmlElementRef[] value() {
return core.value();
}