/** * 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); }
public static boolean hasAnnotation(XSComponent xsComponent, QName qname) { if (xsComponent == null) { return false; } return hasAnnotation(xsComponent.getAnnotation(false), qname) != null; }
public Iterator<XSSchema> iterator(XSComponent contextNode) { return Iterators.singleton(contextNode.getOwnerSchema()); }
/** * If the component maps to a property, forwards to purple, otherwise to green. * * If the component is mapped to a type, this method needs to return true. * See the chart at the class javadoc. */ public void ying( XSComponent sc, @Nullable XSComponent referer ) { if(sc.apply(toPurple)==true || getClassSelector().bindToType(sc,referer)!=null) sc.visit(purple); else sc.visit(green); }
private void checkExpectedContentTypes(XSComponent c) { if(c.getForeignAttribute(WellKnownNamespace.XML_MIME_URI, Const.EXPECTED_CONTENT_TYPES)==null) return; // no such attribute if(c instanceof XSParticle) return; // particles get the same foreign attributes as local element decls, // so we need to skip them if(!stb.isAcknowledgedXmimeContentTypes(c)) { // this is not used getErrorReporter().warning(c.getLocator(),Messages.WARN_UNUSED_EXPECTED_CONTENT_TYPES); } }
Locator loc = sc.getLocator(); String fileName = null; if(loc!=null) { lineNumber = String.valueOf(loc.getLineNumber()); String componentName = sc.apply( new ComponentNameFunction() ); String jdoc = Messages.format( Messages.JAVADOC_HEADING, componentName, fileName, lineNumber ); append(bean,jdoc); out.write("<pre>\n"); SchemaWriter sw = new SchemaWriter(new JavadocEscapeWriter(out)); sc.visit(sw); out.write("</pre>"); append(bean,out.toString());
CElement bean = sc.apply(classBinder); XSSchema os = sc.getOwnerSchema(); BISchemaBinding sb = builder.getBindInfo(os).get(BISchemaBinding.class); if(sb!=null && !sb.map) { getErrorReporter().error(sc.getLocator(), Messages.ERR_REFERENCE_TO_NONEXPORTED_CLASS, sc.apply( new ComponentNameFunction() ) ); getErrorReporter().error(sb.getLocation(), Messages.ERR_REFERENCE_TO_NONEXPORTED_CLASS_MAP_FALSE, os.getTargetNamespace() ); if(referer!=null) getErrorReporter().error(referer.getLocator(), Messages.ERR_REFERENCE_TO_NONEXPORTED_CLASS_REFERER, referer.apply( new ComponentNameFunction() ) );
if(itr.hasNext()) { reportError( src, Messages.format(Messages.ERR_SCD_MATCHED_MULTIPLE_NODES,scd,childNodes.size()) ); errorReceiver.error( target.getLocator(), Messages.format(Messages.ERR_SCD_MATCHED_MULTIPLE_NODES_FIRST) ); errorReceiver.error( itr.next().getLocator(), Messages.format(Messages.ERR_SCD_MATCHED_MULTIPLE_NODES_SECOND) ); XSAnnotation ann = target.getAnnotation(true); BindInfo bi = (BindInfo)ann.getAnnotation(); if(bi==null) {
private void run( Map<String,? extends XSComponent> col ) { for( XSComponent c : col.values() ) c.visit(this); }
private FieldOutline findField(final ClassOutline implClass, final PropertyUse propertyUse) throws SAXException { if (!propertyUse.isFixed()) { for (final FieldOutline field : implClass.getDeclaredFields()) { if (field.getPropertyInfo().getName(true).equals(propertyUse.getName())) { return field; } } this.pluginContext.errorHandler.error(new SAXParseException(MessageFormat.format(GroupInterfaceGenerator.RESOURCE_BUNDLE.getString("error.property-not-found"), propertyUse.declaration.toString(), propertyUse.getName(), implClass.implClass.fullName()), propertyUse.declaration.getLocator())); } return null; }
public Iterator<XSSchema> iterator(XSComponent contextNode) { return contextNode.getRoot().iterateSchema(); }
Locator loc = sc.getLocator(); String fileName = null; if(loc!=null) { lineNumber = String.valueOf(loc.getLineNumber()); String componentName = sc.apply( new ComponentNameFunction() ); String jdoc = Messages.format( Messages.JAVADOC_HEADING, componentName, fileName, lineNumber ); append(bean,jdoc); out.write("<pre>\n"); SchemaWriter sw = new SchemaWriter(new JavadocEscapeWriter(out)); sc.visit(sw); out.write("</pre>"); append(bean,out.toString());
CElement bean = sc.apply(classBinder); XSSchema os = sc.getOwnerSchema(); BISchemaBinding sb = builder.getBindInfo(os).get(BISchemaBinding.class); if(sb!=null && !sb.map) { getErrorReporter().error(sc.getLocator(), Messages.ERR_REFERENCE_TO_NONEXPORTED_CLASS, sc.apply( new ComponentNameFunction() ) ); getErrorReporter().error(sb.getLocation(), Messages.ERR_REFERENCE_TO_NONEXPORTED_CLASS_MAP_FALSE, os.getTargetNamespace() ); if(referer!=null) getErrorReporter().error(referer.getLocator(), Messages.ERR_REFERENCE_TO_NONEXPORTED_CLASS_REFERER, referer.apply( new ComponentNameFunction() ) );
/** * If the component maps to a property, forwards to purple, otherwise to green. * * If the component is mapped to a type, this method needs to return true. * See the chart at the class javadoc. */ public void ying( XSComponent sc, @Nullable XSComponent referer ) { if(sc.apply(toPurple)==true || getClassSelector().bindToType(sc,referer)!=null) sc.visit(purple); else sc.visit(green); }
if(itr.hasNext()) { reportError( src, Messages.format(Messages.ERR_SCD_MATCHED_MULTIPLE_NODES,scd,childNodes.size()) ); errorReceiver.error( target.getLocator(), Messages.format(Messages.ERR_SCD_MATCHED_MULTIPLE_NODES_FIRST) ); errorReceiver.error( itr.next().getLocator(), Messages.format(Messages.ERR_SCD_MATCHED_MULTIPLE_NODES_SECOND) ); XSAnnotation ann = target.getAnnotation(true); BindInfo bi = (BindInfo)ann.getAnnotation(); if(bi==null) {
private void checkExpectedContentTypes(XSComponent c) { if(c.getForeignAttribute(WellKnownNamespace.XML_MIME_URI, Const.EXPECTED_CONTENT_TYPES)==null) return; // no such attribute if(c instanceof XSParticle) return; // particles get the same foreign attributes as local element decls, // so we need to skip them if(!stb.isAcknowledgedXmimeContentTypes(c)) { // this is not used getErrorReporter().warning(c.getLocator(),Messages.WARN_UNUSED_EXPECTED_CONTENT_TYPES); } }
private void run( Map<String,? extends XSComponent> col ) { for( XSComponent c : col.values() ) c.visit(this); }
private void check(BIDeclaration decl, XSComponent c) { if( !decl.isAcknowledged() ) { getErrorReporter().error( decl.getLocation(), Messages.ERR_UNACKNOWLEDGED_CUSTOMIZATION, decl.getName().getLocalPart() ); getErrorReporter().error( c.getLocator(), Messages.ERR_UNACKNOWLEDGED_CUSTOMIZATION_LOCATION); // mark it as acknowledged to avoid // duplicated error messages. decl.markAsAcknowledged(); } for (BIDeclaration d : decl.getChildren()) check(d,c); }
public Iterator<XSSchema> iterator(XSComponent contextNode) { return contextNode.getRoot().iterateSchema(); }
Locator loc = sc.getLocator(); String fileName = null; if(loc!=null) { lineNumber = String.valueOf(loc.getLineNumber()); String componentName = sc.apply( new ComponentNameFunction() ); String jdoc = Messages.format( Messages.JAVADOC_HEADING, componentName, fileName, lineNumber ); append(bean,jdoc); out.write("<pre>\n"); SchemaWriter sw = new SchemaWriter(new JavadocEscapeWriter(out)); sc.visit(sw); out.write("</pre>"); append(bean,out.toString());